forked from rDrama/rDrama
sneed
parent
7308906612
commit
1675bdc2d3
|
@ -62,9 +62,9 @@ def get_logged_in_user():
|
||||||
v.last_active = timestamp
|
v.last_active = timestamp
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
else:
|
else:
|
||||||
g.parsed_agent = str(user_agents.parse(g.agent))
|
ua = str(user_agents.parse(g.agent))
|
||||||
if 'spider' not in g.parsed_agent.lower() and 'bot' not in g.parsed_agent.lower():
|
if 'spider' not in ua.lower() and 'bot' not in ua.lower():
|
||||||
loggedout[session["session_id"]] = (timestamp, g.parsed_agent)
|
loggedout[session["session_id"]] = (timestamp, ua)
|
||||||
|
|
||||||
g.loggedin_counter = len([x for x in loggedin.values() if timestamp-x < LOGGEDIN_ACTIVE_TIME])
|
g.loggedin_counter = len([x for x in loggedin.values() if timestamp-x < LOGGEDIN_ACTIVE_TIME])
|
||||||
cache.set(f'{SITE}_loggedin', loggedin)
|
cache.set(f'{SITE}_loggedin', loggedin)
|
||||||
|
|
Loading…
Reference in New Issue