Dramatic performance optimitations clean sessions in startup request

This commit is contained in:
Antonio de la Rosa 2016-08-03 05:30:38 +02:00
parent a04a9e1e86
commit 793b7a040f
3 changed files with 51 additions and 9 deletions

View file

@ -66,16 +66,26 @@ if hasattr(config, 'format_time'):
if hasattr(config, 'timezone'):
timezone=config.timezone
@hook('before_request')
#@hook('before_request')
def set_timezone():
environ['TZ']=environ.get('TZ', timezone)
if environ['TZ']!=timezone:
environ['TZ']=timezone
time.tzset()
def set_timezone_session():
s=get_session()
timezone_local=timezone
if s!=None:
timezone_local=s.get('timezone', timezone)
if 'timezone' in s:
timezone_local=s['timezone']
#timezone_local=s.get('timezone', timezone)
environ['TZ']=environ.get('TZ', timezone_local)