From 6b4f2f713bfca7f2b013e3c0f8940a70b7507f11 Mon Sep 17 00:00:00 2001 From: krateng Date: Thu, 7 Apr 2022 05:52:22 +0200 Subject: [PATCH] Adjusted image cache update --- maloja/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maloja/images.py b/maloja/images.py index ba399f7..757be39 100644 --- a/maloja/images.py +++ b/maloja/images.py @@ -58,7 +58,7 @@ def get_image_from_cache(id,table): return None # no cache entry def set_image_in_cache(id,table,url): - remove_image_from_cache(id,table) + #remove_image_from_cache(id,table) now = int(datetime.datetime.now().timestamp()) if url is None: expire = now + (malojaconfig["CACHE_EXPIRE_NEGATIVE"] * 24 * 3600) @@ -73,7 +73,7 @@ def set_image_in_cache(id,table,url): url=url, expire=expire, raw=raw - ) + ).on_conflict_do_update() result = conn.execute(op) def remove_image_from_cache(id,table):