calc users: log so we can find the root of this problem

pull/16/head
justcool393 2022-11-25 20:21:38 -06:00
parent 46204ea223
commit ba6e4721d3
1 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,17 @@ def session_init():
session["session_id"] = secrets.token_hex(49)
def calc_users(v):
# temp logging code
if not hasattr(g, 'is_api_or_xhr'):
print("calc_users called with missing context data")
if request:
print(f"while serving {request.method} {request.full_path}")
print(f"user agent: {g.agent}")
else:
print("no request context")
print(f"v: {v}")
print(f"db?: {bool(g.db)}")
# end temp logging code
loggedin = cache.get(f'{SITE}_loggedin') or {}
loggedout = cache.get(f'{SITE}_loggedout') or {}
timestamp = int(time.time())