mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Adjusted image cache update
This commit is contained in:
parent
4682914b88
commit
6b4f2f713b
@ -58,7 +58,7 @@ def get_image_from_cache(id,table):
|
|||||||
return None # no cache entry
|
return None # no cache entry
|
||||||
|
|
||||||
def set_image_in_cache(id,table,url):
|
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())
|
now = int(datetime.datetime.now().timestamp())
|
||||||
if url is None:
|
if url is None:
|
||||||
expire = now + (malojaconfig["CACHE_EXPIRE_NEGATIVE"] * 24 * 3600)
|
expire = now + (malojaconfig["CACHE_EXPIRE_NEGATIVE"] * 24 * 3600)
|
||||||
@ -73,7 +73,7 @@ def set_image_in_cache(id,table,url):
|
|||||||
url=url,
|
url=url,
|
||||||
expire=expire,
|
expire=expire,
|
||||||
raw=raw
|
raw=raw
|
||||||
)
|
).on_conflict_do_update()
|
||||||
result = conn.execute(op)
|
result = conn.execute(op)
|
||||||
|
|
||||||
def remove_image_from_cache(id,table):
|
def remove_image_from_cache(id,table):
|
||||||
|
Loading…
Reference in New Issue
Block a user