mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-03-05 03:02:49 +00:00
Update last_send when receiving a HEARTBEAT request
This commit is contained in:
@@ -210,6 +210,10 @@ class KeepAliveHandler(threading.Thread):
|
|||||||
def tick(self) -> None:
|
def tick(self) -> None:
|
||||||
self._last_recv = time.perf_counter()
|
self._last_recv = time.perf_counter()
|
||||||
|
|
||||||
|
def beat(self) -> Dict[str, Any]:
|
||||||
|
self._last_send = time.perf_counter()
|
||||||
|
return self.get_payload()
|
||||||
|
|
||||||
def ack(self) -> None:
|
def ack(self) -> None:
|
||||||
ack_time = time.perf_counter()
|
ack_time = time.perf_counter()
|
||||||
self._last_ack = ack_time
|
self._last_ack = ack_time
|
||||||
@@ -541,7 +545,7 @@ class DiscordWebSocket:
|
|||||||
|
|
||||||
if op == self.HEARTBEAT:
|
if op == self.HEARTBEAT:
|
||||||
if self._keep_alive:
|
if self._keep_alive:
|
||||||
beat = self._keep_alive.get_payload()
|
beat = self._keep_alive.beat()
|
||||||
await self.send_as_json(beat)
|
await self.send_as_json(beat)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user