@@ -401,16 +401,22 @@ async def _get_updates_cleanup() -> None:
401
401
_LOGGER .debug (
402
402
"Calling `get_updates` one more time to mark all fetched updates as read."
403
403
)
404
- await self .bot .get_updates (
405
- offset = self ._last_update_id ,
406
- # We don't want to do long polling here!
407
- timeout = 2 ,
408
- read_timeout = read_timeout ,
409
- connect_timeout = connect_timeout ,
410
- write_timeout = write_timeout ,
411
- pool_timeout = pool_timeout ,
412
- allowed_updates = allowed_updates ,
413
- )
404
+ try :
405
+ await self .bot .get_updates (
406
+ offset = self ._last_update_id ,
407
+ # We don't want to do long polling here!
408
+ timeout = 0 ,
409
+ read_timeout = read_timeout ,
410
+ connect_timeout = connect_timeout ,
411
+ write_timeout = write_timeout ,
412
+ pool_timeout = pool_timeout ,
413
+ allowed_updates = allowed_updates ,
414
+ )
415
+ except TimedOut :
416
+ _LOGGER .debug (
417
+ "`get_updates` timed out while marking updates as read. The last fetched "
418
+ "updates may be fetched again on the next polling start."
419
+ )
414
420
415
421
self .__polling_cleanup_cb = _get_updates_cleanup
416
422
0 commit comments