(self, stream)
| 59 | return values |
| 60 | |
| 61 | def unexpired_hashes_by_stream(self, stream): |
| 62 | with self.lock: |
| 63 | t = int(time.time()) |
| 64 | hashes = [x for x, value in self._inventory.items() if value.stream == stream and value.expires > t] |
| 65 | hashes += (str(payload) for payload, in sqlQuery('SELECT hash FROM inventory WHERE streamnumber=? AND expirestime>?', stream, t)) |
| 66 | return hashes |
| 67 | |
| 68 | def flush(self): |
| 69 | with self.lock: # If you use both the inventoryLock and the sqlLock, always use the inventoryLock OUTSIDE of the sqlLock. |
no test coverage detected