use correct type when deleting old database cache items

This commit is contained in:
Izalia Mae 2024-09-15 07:29:12 -04:00
parent e6845136eb
commit c5633808f7

View file

@ -243,11 +243,10 @@ class SqlCache(Cache):
if self._db is None: if self._db is None:
raise RuntimeError("Database has not been setup") raise RuntimeError("Database has not been setup")
limit = Date.new_utc() - timedelta(days = days) date = Date.new_utc() - timedelta(days = days)
params = {"limit": limit.timestamp()}
with self._db.session(True) as conn: with self._db.session(True) as conn:
with conn.execute("DELETE FROM cache WHERE updated < :limit", params): with conn.execute("DELETE FROM cache WHERE updated < :limit", {"limit": date}):
pass pass