remove announcement job after we fully check the db for live streams
This commit is contained in:
parent
0bbc81e50f
commit
7dcac2f191
1 changed files with 11 additions and 10 deletions
|
@ -82,17 +82,18 @@ async def update_database():
|
|||
logger_discord.info(f'{name} live stream detected!')
|
||||
scheduler.add_job(func=announce_live_channel, seconds=60, id='announce_live_channel', args=(name))
|
||||
return
|
||||
try:
|
||||
job = scheduler.get_job('announce_live_channel')
|
||||
if job:
|
||||
scheduler.remove_job('announce_live_channel')
|
||||
live_channel = bot.get_channel(announce_channel_id)
|
||||
logger_discord.info(f'{name} finished')
|
||||
await live_channel.send(f'{name} finished')
|
||||
else:
|
||||
return
|
||||
except JobLookupError:
|
||||
|
||||
try:
|
||||
job = scheduler.get_job('announce_live_channel')
|
||||
if job:
|
||||
scheduler.remove_job('announce_live_channel')
|
||||
live_channel = bot.get_channel(announce_channel_id)
|
||||
logger_discord.info(f'{name} finished')
|
||||
await live_channel.send(f'{name} finished')
|
||||
else:
|
||||
return
|
||||
except JobLookupError:
|
||||
return
|
||||
|
||||
async def announce_live_channel(name):
|
||||
if announce_channel_id == 'disabled':
|
||||
|
|
Loading…
Reference in a new issue