Skip to content

Commit

Permalink
use float timedelta instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
fheijden committed Mar 17, 2024
1 parent ff67f95 commit 8f2ea2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code4me-server/src/user_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8f2ea2a

Please sign in to comment.