remove joblookuperror since we dont use it
This commit is contained in:
parent
220795a6fb
commit
c6a98593d1
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,6 @@ import discord
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||||
from apscheduler.jobstores.base import JobLookupError
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Read env variables
|
# Read env variables
|
||||||
|
@ -93,8 +92,10 @@ 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
|
# Manually execute the job once immediately
|
||||||
scheduler.get_job('announce_live_channel').modify(next_run_time=datetime.now())
|
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:
|
||||||
|
@ -106,8 +107,8 @@ async def update_database():
|
||||||
scheduler.remove_job('announce_live_channel')
|
scheduler.remove_job('announce_live_channel')
|
||||||
logger_discord.info(f'Live stream is offline.')
|
logger_discord.info(f'Live stream is offline.')
|
||||||
if live_channel_id != 0:
|
if live_channel_id != 0:
|
||||||
update_channel = bot.get_channel(live_channel_id)
|
live_channel = bot.get_channel(live_channel_id)
|
||||||
await update_channel.send('Live stream is offline.')
|
await live_channel.send('Live stream is offline.')
|
||||||
|
|
||||||
async def announce_live_channel(stream_name):
|
async def announce_live_channel(stream_name):
|
||||||
logger_discord.info(f'{stream_name} is live!')
|
logger_discord.info(f'{stream_name} is live!')
|
||||||
|
|
Loading…
Reference in a new issue