File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 44
44
KEEPALIVE_TASK_NAME = "ADT Pulse Keepalive Task"
45
45
# backoff time before warning in wait_for_update()
46
46
WARN_TRANSIENT_FAILURE_THRESHOLD = 2
47
- FULL_LOGOUT_INTERVAL = 24 * 60 * 60
47
+ FULL_LOGOUT_INTERVAL = 6 * 60 * 60
48
48
49
49
50
50
class PyADTPulseAsync :
@@ -261,7 +261,9 @@ def should_relogin(relogin_interval: int) -> bool:
261
261
> randint (int (0.75 * relogin_interval ), relogin_interval )
262
262
)
263
263
264
- next_full_logout_time = time .time () + FULL_LOGOUT_INTERVAL
264
+ next_full_logout_time = time .time () + randint (
265
+ int (0.75 * FULL_LOGOUT_INTERVAL ), FULL_LOGOUT_INTERVAL
266
+ )
265
267
response : str | None
266
268
task_name : str = self ._get_task_name (self ._timeout_task , KEEPALIVE_TASK_NAME )
267
269
LOG .debug ("creating %s" , task_name )
@@ -291,7 +293,9 @@ def should_relogin(relogin_interval: int) -> bool:
291
293
)
292
294
await self ._sync_check_sleeping .wait ()
293
295
if msg == "full" :
294
- next_full_logout_time = time .time () + FULL_LOGOUT_INTERVAL
296
+ next_full_logout_time = time .time () + randint (
297
+ int (0.75 * FULL_LOGOUT_INTERVAL ), FULL_LOGOUT_INTERVAL
298
+ )
295
299
await self .async_logout ()
296
300
else :
297
301
await self ._pulse_connection .quick_logout ()
You can’t perform that action at this time.
0 commit comments