From baf034f68b3fc8ed13e1bc96437dff84d7f52126 Mon Sep 17 00:00:00 2001 From: TJ Porter Date: Sun, 2 Jul 2023 02:45:56 -0500 Subject: [PATCH] Potentially fixed asyncio error about unhandled SystemExit exception in an async task --- scripts/notify-discord-stampy-offline.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/notify-discord-stampy-offline.py b/scripts/notify-discord-stampy-offline.py index 809e7d1e..eeb7998d 100644 --- a/scripts/notify-discord-stampy-offline.py +++ b/scripts/notify-discord-stampy-offline.py @@ -1,8 +1,8 @@ -import discord -from git import Repo, cmd -from structlog import get_logger from config import bot_private_channel_id from config import discord_token +from git import cmd, Repo +from structlog import get_logger +import discord intents = discord.Intents.default() client = discord.Client(intents=intents) @@ -29,7 +29,7 @@ async def on_ready(): if bot_private_channel_id: await client.get_channel(int(bot_private_channel_id)).send(message) log.info("notify_discord_script", status="COMPLETE") - exit() + await client.close() client.run(discord_token)