mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 14:42:10 +00:00
Disable notification cache
This commit is contained in:
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 django.core.cache import cache
|
||||||
|
|
||||||
from seahub.notifications.models import Notification
|
from seahub.notifications.models import Notification
|
||||||
|
from seahub.notifications.settings import NOTIFICATION_CACHE_TIMEOUT
|
||||||
def refresh_cache():
|
def refresh_cache():
|
||||||
"""
|
"""
|
||||||
Function to be called when change primary notification.
|
Function to be called when change primary notification.
|
||||||
"""
|
"""
|
||||||
cache.set('CUR_TOPINFO', Notification.objects.all().filter(primary=1),
|
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_MAX_AVATARS_PER_USER = 1
|
||||||
AVATAR_CACHE_TIMEOUT = 0
|
AVATAR_CACHE_TIMEOUT = 0
|
||||||
|
|
||||||
|
#info-bar notification
|
||||||
|
NOTIFICATION_CACHE_TIMEOUT = 0
|
||||||
|
|
||||||
LOGIN_URL = SITE_ROOT + 'accounts/login'
|
LOGIN_URL = SITE_ROOT + 'accounts/login'
|
||||||
|
|
||||||
# profile
|
# profile
|
||||||
|
Reference in New Issue
Block a user