reset reconnecting factory's internal delay

This commit is contained in:
InspectorCaracal 2022-12-13 21:13:53 -07:00 committed by GitHub
parent 8a97051218
commit f204535baf

View file

@ -195,6 +195,9 @@ class DiscordWebsocketServerFactory(WebSocketClientFactory, protocol.Reconnectin
else:
# we don't know where to reconnect to! we'll start from the beginning
self.url = None
# reset the internal delay, since this is a deliberate disconnect
self.delay = self.initialDelay
# disconnect to allow the reconnection process to kick in
self.bot.sendClose()
self.sessionhandler.server_disconnect(self.bot)