Skip to content

Commit

Permalink
moved defer logic to VerifyRunCog
Browse files Browse the repository at this point in the history
  • Loading branch information
b9r5 committed Dec 5, 2024
1 parent 20b6bca commit 3971120
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/discord-cluster-manager/cogs/github_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ async def run_github(
message = f"Created thread {thread.mention} for your GitHub job"

if use_followup:
if not interaction.response.is_done():
await interaction.response.defer()
await interaction.followup.send(message)
else:
await interaction.response.send_message(message)
Expand Down
2 changes: 0 additions & 2 deletions src/discord-cluster-manager/cogs/modal_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ async def run_modal(
message = f"Created thread {thread.mention} for your Modal job"

if use_followup:
if not interaction.response.is_done():
await interaction.response.defer()
await interaction.followup.send(message)
else:
await interaction.response.send_message(message)
Expand Down
3 changes: 3 additions & 0 deletions src/discord-cluster-manager/cogs/verify_run_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ async def verify_runs(self, interaction: discord.Interaction):
"""Verify runs on on Modal, GitHub Nvidia, and GitHub AMD."""

try:
if not interaction.response.is_done():
await interaction.response.defer()

modal_cog = self.bot.get_cog('ModalCog')
github_cog = self.bot.get_cog('GitHubCog')

Expand Down

0 comments on commit 3971120

Please sign in to comment.