mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-09 16:10:51 +03:00
Restart Conversation total timeout upon __aenter__
This commit is contained in:
parent
a688c8a4ce
commit
5f73482d29
|
@ -33,10 +33,8 @@ class Conversation(ChatGetter):
|
||||||
self._broadcast = None
|
self._broadcast = None
|
||||||
|
|
||||||
self._timeout = timeout
|
self._timeout = timeout
|
||||||
if total_timeout:
|
self._total_timeout = total_timeout
|
||||||
self._total_due = time.time() + total_timeout
|
self._total_due = None
|
||||||
else:
|
|
||||||
self._total_due = float('inf')
|
|
||||||
|
|
||||||
self._outgoing = set()
|
self._outgoing = set()
|
||||||
self._last_outgoing = 0
|
self._last_outgoing = 0
|
||||||
|
@ -305,6 +303,11 @@ class Conversation(ChatGetter):
|
||||||
self._last_incoming = 0
|
self._last_incoming = 0
|
||||||
self._pending_responses.clear()
|
self._pending_responses.clear()
|
||||||
self._response_indices.clear()
|
self._response_indices.clear()
|
||||||
|
if self._total_timeout:
|
||||||
|
self._total_due = time.time() + self._total_timeout
|
||||||
|
else:
|
||||||
|
self._total_due = float('inf')
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
async def __aexit__(self, *args):
|
async def __aexit__(self, *args):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user