forked from rDrama/rDrama
1
0
Fork 0

same as last commit

master
Aevann 2023-03-10 01:43:52 +02:00
parent d8575791be
commit 24101995af
1 changed files with 6 additions and 4 deletions

View File

@ -66,10 +66,12 @@ def get_logged_in_user():
v.poor = session.get('poor')
# Check against last_active + ACTIVE_TIME to reduce frequency of
# UPDATEs in exchange for a ±ACTIVE_TIME margin of error.
timestamp = int(time.time())
if (v.last_active + LOGGEDIN_ACTIVE_TIME) < timestamp:
v.last_active = timestamp
g.db.add(v)
if not session.get("GLOBAL"):
timestamp = int(time.time())
if (v.last_active + LOGGEDIN_ACTIVE_TIME) < timestamp:
v.last_active = timestamp
g.db.add(v)
if SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG' and not v:
abort(404)