improved satbility on session expiration

This commit is contained in:
2024-10-15 13:38:18 +02:00
parent 5841ffa2ed
commit 7254732847
4 changed files with 61 additions and 39 deletions
+7
View File
@@ -1,4 +1,5 @@
import time
import datetime
import os
@@ -23,6 +24,12 @@ def to_date_str(_date: dict):
return f"{_date['year']:04d}-{_date['month']:02d}-{_date['day']:02d}"
def create_timestamp():
now = datetime.datetime.now(datetime.UTC)
res = now.strftime('%Y-%m-%dT%H:%M:%S') + ('.%03dZ' % (now.microsecond / 1000))
return res
def date_has_changed(d1: dict, d2: dict, fields=['year', 'month', 'day']):
count = 0