File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5555
5656from discord_protos import UserSettingsType
5757
58- from .errors import ClientException , DiscordException , InvalidData , NotFound
58+ from .errors import ClientException , InvalidData , NotFound
5959from .guild import Guild
6060from .activity import BaseActivity , create_activity , Session
6161from .user import User , ClientUser
105105from .experiment import UserExperiment , GuildExperiment
106106from .metadata import Metadata
107107from .directory import DirectoryEntry
108- from .backoff import ExponentialBackoff
109108
110109if TYPE_CHECKING :
111110 from typing_extensions import Self
@@ -606,8 +605,12 @@ def _cancel(self) -> None:
606605 async def _tick_task (self ) -> None :
607606 try :
608607 await asyncio .sleep (self .TICK_TIMEOUT )
609- await self ._flush ()
610- self ._task = None
608+ if self ._state .ws .open :
609+ await self ._flush ()
610+ self ._task = None
611+ else :
612+ self ._task = None
613+ self ._tick ()
611614 except asyncio .CancelledError :
612615 pass
613616
You can’t perform that action at this time.
0 commit comments