Fixed inverted condition.
@@ -766,11 +766,9 @@ class GatewayShardImpl(shard.GatewayShard):
try:
last_started_at = date.monotonic()
- should_die = await self._run_once()
-
- if not should_die:
- continue
+ should_restart = await self._run_once()
+ if not should_restart:
self._logger.info("shard has disconnected and shut down normally")
return
