execute the announcement job immediately after first run
This commit is contained in:
parent
f461f58a00
commit
9f6ae93762
1 changed files with 2 additions and 0 deletions
|
@ -87,6 +87,8 @@ async def update_database():
|
||||||
# Job doesn't exist, so add it
|
# Job doesn't exist, so add it
|
||||||
logger_discord.info(f'{stream_name} live stream detected!')
|
logger_discord.info(f'{stream_name} live stream detected!')
|
||||||
scheduler.add_job(func=announce_live_channel, trigger='interval', seconds=60, id='announce_live_channel', args=(stream_name,))
|
scheduler.add_job(func=announce_live_channel, trigger='interval', seconds=60, id='announce_live_channel', args=(stream_name,))
|
||||||
|
# Manually execute the job once immediately
|
||||||
|
scheduler.get_job('announce_live_channel').modify(next_run_time=datetime.now())
|
||||||
# Exit since we found one
|
# Exit since we found one
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue