1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-12 18:05:05 +00:00

Disable notification cache

This commit is contained in:
xiez 2012-06-06 13:55:55 +08:00
parent c5daf3879a
commit 7abacb8b6a
3 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,3 @@
from django.conf import settings
NOTIFICATION_CACHE_TIMEOUT = getattr(settings, 'NOTIFICATION_CACHE_TIMEOUT', 24*60*60)

View File

@ -1,11 +1,11 @@
from django.core.cache import cache
from seahub.notifications.models import Notification
from seahub.notifications.settings import NOTIFICATION_CACHE_TIMEOUT
def refresh_cache():
"""
Function to be called when change primary notification.
"""
cache.set('CUR_TOPINFO', Notification.objects.all().filter(primary=1),
24*60*60)
NOTIFICATION_CACHE_TIMEOUT)

View File

@ -185,6 +185,9 @@ AUTO_GENERATE_AVATAR_SIZES = (80, 16)
AVATAR_MAX_AVATARS_PER_USER = 1
AVATAR_CACHE_TIMEOUT = 0
#info-bar notification
NOTIFICATION_CACHE_TIMEOUT = 0
LOGIN_URL = SITE_ROOT + 'accounts/login'
# profile