From 8f2ea2a67e51159f0491c5472ac9475c0848be29 Mon Sep 17 00:00:00 2001 From: fheijden Date: Sun, 17 Mar 2024 17:19:56 +0100 Subject: [PATCH] use float timedelta instead of int --- code4me-server/src/user_study.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code4me-server/src/user_study.py b/code4me-server/src/user_study.py index 4348048..b5d2dff 100644 --- a/code4me-server/src/user_study.py +++ b/code4me-server/src/user_study.py @@ -23,7 +23,7 @@ def get_request_filter(user_uuid: str, time: datetime) -> Callable[[dict], bool] 30 mins since the last completion. Otherwise, they are assigned a filter at random ''' if user_uuid in cache and (time - cache[user_uuid][0]).seconds < SESSION_TIMEOUT: - filter_type, last_access = cache[user_uuid][1], (time - cache[user_uuid][0]).seconds + filter_type, last_access = cache[user_uuid][1], (time - cache[user_uuid][0]).total_seconds() else: filter_type, last_access = random.choice(list(filters.keys())), 0.0