Skip to content

Commit

Permalink
Fixed scrap_ fcb_news after get_output > dict
Browse files Browse the repository at this point in the history
  • Loading branch information
geirawsm committed Dec 24, 2024
1 parent 0192e24 commit fa40182
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions sausage_bot/cogs/scrape_fcb_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,20 @@ async def get_tasks():
task_list = await get_tasks()
for task in task_list:
log.debug(f'checking task: {task}')
if task[0] == 'post_news':
if task[1] == 'started':
log.debug(f'`{task[0]}` is set as `{task[1]}`, starting...')
if task['task'] == 'post_news':
if task['status'] == 'started':
log.debug(
'`{}` is set as `{}`, stopping...'.format(
task['task'], task['status']
)
)
scrape_and_post.post_fcb_news.start()
elif task[1] == 'stopped':
log.debug(f'`{task[0]}` is set as `{task[1]}`')
elif task['status'] == 'stopped':
log.debug(
'`{}` is set as `{}`, starting...'.format(
task['task'], task['status']
)
)
scrape_and_post.post_fcb_news.cancel()


Expand Down

0 comments on commit fa40182

Please sign in to comment.