| 182 | |
| 183 | |
| 184 | class CLISessionDatabaseSweeper: |
| 185 | _DELETE_RECORDS = """ |
| 186 | DELETE FROM session |
| 187 | WHERE timestamp < ? |
| 188 | """ |
| 189 | |
| 190 | def __init__(self, connection): |
| 191 | self._connection = connection |
| 192 | |
| 193 | def sweep(self, timestamp): |
| 194 | try: |
| 195 | self._connection.execute(self._DELETE_RECORDS, (timestamp,)) |
| 196 | except Exception: |
| 197 | # This is just a background cleanup task. No need to |
| 198 | # handle it or direct to stderr. |
| 199 | return |
| 200 | |
| 201 | |
| 202 | class CLISessionGenerator: |
no outgoing calls