From 7ff628d195f465375b8669828cbb606db3733259 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 11 Jan 2023 18:50:53 +0000 Subject: [PATCH] Increase usage track username expiration time --- apiserver/apiserver/api/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index 450c1c6..b92c9f4 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -780,7 +780,8 @@ class StatsViewSet(viewsets.ViewSet, List): if should_count: start_new_use = not last_use or last_use.finished_at or last_use.username != username if start_new_use: - if username_isfrom_track and time.time() - track[device]['time'] > 20*60: + username_isexpired = time.time() - track[device]['time'] > 2*60*60 # two hours + if username_isfrom_track and username_isexpired: msg = 'Usage tracker problem expired username {} for device: {}'.format(username, device) utils.alert_tanner(msg) logger.error(msg)