From c5633808f7670b16a13100ef7f871ebb47b69189 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Sun, 15 Sep 2024 07:29:12 -0400 Subject: [PATCH] use correct type when deleting old database cache items --- relay/cache.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/relay/cache.py b/relay/cache.py index 0c76b8e..3960c36 100644 --- a/relay/cache.py +++ b/relay/cache.py @@ -243,11 +243,10 @@ class SqlCache(Cache): if self._db is None: raise RuntimeError("Database has not been setup") - limit = Date.new_utc() - timedelta(days = days) - params = {"limit": limit.timestamp()} + date = Date.new_utc() - timedelta(days = days) 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