mirror of https://github.com/zulip/zulip.git
Move SERVER_GENERATION definition to settings.py
(imported from commit 4be2b912a63f49f525c66f46db0bc5c466ad364f)
This commit is contained in:
parent
5b4536172c
commit
d1b9ab9fd8
|
@ -2,9 +2,12 @@
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
from zephyr.openid import openid_failure_handler
|
from zephyr.openid import openid_failure_handler
|
||||||
|
|
||||||
|
SERVER_GENERATION = int(time.time())
|
||||||
|
|
||||||
DEPLOYED = (('humbughq.com' in platform.node())
|
DEPLOYED = (('humbughq.com' in platform.node())
|
||||||
or os.path.exists('/etc/humbug-server'))
|
or os.path.exists('/etc/humbug-server'))
|
||||||
STAGING_DEPLOYED = (platform.node() == 'staging.humbughq.com')
|
STAGING_DEPLOYED = (platform.node() == 'staging.humbughq.com')
|
||||||
|
|
|
@ -21,8 +21,6 @@ import time
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
SERVER_GENERATION = int(time.time())
|
|
||||||
|
|
||||||
@internal_notify_view
|
@internal_notify_view
|
||||||
def notify(request):
|
def notify(request):
|
||||||
process_notification(simplejson.loads(request.POST['data']))
|
process_notification(simplejson.loads(request.POST['data']))
|
||||||
|
@ -55,7 +53,7 @@ def format_updates_response(messages=[], apply_markdown=True,
|
||||||
"msg": "",
|
"msg": "",
|
||||||
'update_types': update_types}
|
'update_types': update_types}
|
||||||
if client_server_generation is not None:
|
if client_server_generation is not None:
|
||||||
ret['server_generation'] = SERVER_GENERATION
|
ret['server_generation'] = settings.SERVER_GENERATION
|
||||||
if new_pointer is not None:
|
if new_pointer is not None:
|
||||||
ret['new_pointer'] = new_pointer
|
ret['new_pointer'] = new_pointer
|
||||||
|
|
||||||
|
@ -71,7 +69,7 @@ def return_messages_immediately(user_profile, client_id, last,
|
||||||
update_types.append("nonblocking_request")
|
update_types.append("nonblocking_request")
|
||||||
|
|
||||||
if (client_server_generation is not None and
|
if (client_server_generation is not None and
|
||||||
client_server_generation != SERVER_GENERATION):
|
client_server_generation != settings.SERVER_GENERATION):
|
||||||
update_types.append("client_reload")
|
update_types.append("client_reload")
|
||||||
|
|
||||||
ptr = get_user_pointer(user_profile.id)
|
ptr = get_user_pointer(user_profile.id)
|
||||||
|
|
Loading…
Reference in New Issue