From 2ec0eaf5562bca70f59a474ecdcdab8399ac49f9 Mon Sep 17 00:00:00 2001 From: deflax Date: Sat, 8 Feb 2025 03:21:50 +0000 Subject: [PATCH] execute query_database on start --- src/discordbot/discordbot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/discordbot/discordbot.py b/src/discordbot/discordbot.py index 908949d..99f7407 100644 --- a/src/discordbot/discordbot.py +++ b/src/discordbot/discordbot.py @@ -44,9 +44,11 @@ rec_path = "/recordings" # Bot functions @bot.event async def on_ready(): - # Schedule a database update - scheduler.add_job(func=query_database, trigger='interval', seconds=30, id='query_database') scheduler.start() + + # Schedule a database update + scheduler.add_job(func=query_database, trigger='interval', seconds=30, id='query_database') + scheduler.get_job('query_database').modify(next_run_time=datetime.now()) logger_discord.info(scheduler.print_jobs()) @bot.command(name='hello', help='Say hello to the bot')