diff --git a/agents/broski-bot/cogs/status_cog.py b/agents/broski-bot/cogs/status_cog.py index 9e408168..9b4134d5 100644 --- a/agents/broski-bot/cogs/status_cog.py +++ b/agents/broski-bot/cogs/status_cog.py @@ -10,6 +10,7 @@ - 4 spaces indent """ +import asyncio import discord from discord.ext import commands import subprocess @@ -36,7 +37,10 @@ async def status(self, ctx): ) try: - result = subprocess.run( + # subprocess.run blocks for up to 10s. On discord.py's loop that + # stalls the gateway heartbeat and every other command with it. + result = await asyncio.to_thread( + subprocess.run, [ "docker", "ps", "--format",