Adjust sleep intervals to avoid trips without realtime data expiring
This commit is contained in:
parent
aacbdb8450
commit
16cbc23c1a
@ -147,6 +147,8 @@ def get_next_refresh(data: dict):
|
|||||||
times.sort()
|
times.sort()
|
||||||
for time in times:
|
for time in times:
|
||||||
if (datetime.datetime.fromtimestamp(time) - datetime.datetime.now()) > datetime.timedelta(seconds=30):
|
if (datetime.datetime.fromtimestamp(time) - datetime.datetime.now()) > datetime.timedelta(seconds=30):
|
||||||
|
if (datetime.datetime.fromtimestamp(time)-datetime.datetime.now()) > datetime.timedelta(minutes=5):
|
||||||
|
return (datetime.datetime.now()+datetime.timedelta(minutes=5)).timestamp()
|
||||||
return time
|
return time
|
||||||
return (datetime.datetime.now() + datetime.timedelta(seconds=60)).timestamp()
|
return (datetime.datetime.now() + datetime.timedelta(seconds=60)).timestamp()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user