Skip to content

Commit

Permalink
fixed loops
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCataliasTNT2k committed Apr 14, 2024
1 parent 2df5d44 commit f365fd8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion general/voice_channel/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ async def on_ready(self):

try:
self.vc_loop.start()
except RuntimeError:
except Exception as e:
print(e)
self.vc_loop.restart()

@tasks.loop(minutes=30)
Expand Down
3 changes: 2 additions & 1 deletion information/heartbeat/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ async def on_ready(self):

try:
self.status_loop.start()
except RuntimeError:
except Exception as e:
print(e)
self.status_loop.restart()

self.initialized = True
3 changes: 2 additions & 1 deletion integrations/reddit/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ async def start_loop(self, interval):
self.reddit_loop.change_interval(hours=interval)
try:
self.reddit_loop.start()
except RuntimeError:
except Exception as e:
print(e)
self.reddit_loop.restart()

@commands.group()
Expand Down
3 changes: 2 additions & 1 deletion moderation/autoclear/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class AutoClearCog(Cog, name="AutoClear"):
async def on_ready(self):
try:
self.loop.start()
except RuntimeError:
except Exception as e:
print(e)
self.loop.restart()

@tasks.loop(minutes=5)
Expand Down
3 changes: 2 additions & 1 deletion moderation/logging/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ async def handle_ignore_message_delete(self, message: Message):
async def on_ready(self):
try:
self.cleanup_loop.start()
except RuntimeError:
except Exception as e:
print(e)
self.cleanup_loop.restart()

@tasks.loop(minutes=30)
Expand Down
3 changes: 2 additions & 1 deletion moderation/mod/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ async def on_ready(self):

try:
self.mod_loop.start()
except RuntimeError:
except Exception as e:
print(e)
self.mod_loop.restart()

@tasks.loop(minutes=30)
Expand Down

0 comments on commit f365fd8

Please sign in to comment.