Skip to content

Commit

Permalink
database: fix sql query
Browse files Browse the repository at this point in the history
  • Loading branch information
Morg42 authored Oct 19, 2024
1 parent cafceb1 commit fdb96f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ def _delete_orphan(self, item_path):
return True

cur = self._db_maint.cursor()
self._execute(self._prepare("DELETE FROM {log} WHERE item_id = :id ORDER BY time ASC LIMIT :maxrecords;"), {'id': item_id, 'maxrecords': self.delete_orphan_chunk_size}, cur=cur)
self._execute(self._prepare("DELETE FROM {log} WHERE item_id = :id LIMIT :maxrecords;"), {'id': item_id, 'maxrecords': self.delete_orphan_chunk_size}, cur=cur)
delete_orphan_chunk_size_str = f"{self.delete_orphan_chunk_size:,}".replace(',', '.')
self.logger.info(f"_delete_orphan: Deleted (up to) {delete_orphan_chunk_size_str} log entries for Item {item_path}")
cur.close()
Expand Down

0 comments on commit fdb96f8

Please sign in to comment.