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:
parent
c5daf3879a
commit
7abacb8b6a
3
notifications/settings.py
Normal file
3
notifications/settings.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.conf import settings
|
||||
|
||||
NOTIFICATION_CACHE_TIMEOUT = getattr(settings, 'NOTIFICATION_CACHE_TIMEOUT', 24*60*60)
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user