Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 48a2d1fe authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

controllers/notification.py optimised checking of cache in get_active_notificationss

parent 856399f1
......@@ -177,9 +177,8 @@ def get_active_notifications():
# Try try to overwrite current cache with None.
# If it works the cache has expired or this is the first call
cached = cache.ram(key, lambda: None, time_expire=CACHE_EXPIRY)
# Force retrieval of the cache even if no value is set
cached = cache.ram(key, lambda: None, time_expire=None)
if not cached:
# No cache found: query database
if (request.vars['type'] is not None):
......@@ -202,7 +201,6 @@ def get_active_notifications():
query = query.find(lambda row: row.user_preference.val is None)
cached = cache.ram(key, lambda: query, time_expire=CACHE_EXPIRY)
#TODO sanitize this response
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment