mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 14:38:00 +00:00
use correct type when deleting old database cache items
This commit is contained in:
parent
e6845136eb
commit
c5633808f7
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue