Fixed scheduler-related issues
This commit is contained in:
parent
40376d2e6d
commit
d5691c2bbb
@ -14,6 +14,9 @@ class PycordBot(LibPycordBot):
|
||||
|
||||
self.client_session = ClientSession()
|
||||
|
||||
if self.scheduler is None:
|
||||
return
|
||||
|
||||
# Scheduler job for DHL parcel tracking
|
||||
self.scheduler.add_job(
|
||||
update_tracks_dhl,
|
||||
@ -40,6 +43,8 @@ class PycordBot(LibPycordBot):
|
||||
|
||||
async def close(self, *args: Any, **kwargs: Any) -> None:
|
||||
await self.client_session.close()
|
||||
|
||||
if self.scheduler is not None:
|
||||
self.scheduler.shutdown()
|
||||
|
||||
await super().close(*args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user