diff --git a/jarvis_tasks/tasks/reddit.py b/jarvis_tasks/tasks/reddit.py index 1e97e95..f1cb53e 100644 --- a/jarvis_tasks/tasks/reddit.py +++ b/jarvis_tasks/tasks/reddit.py @@ -174,7 +174,7 @@ async def reddit(bot: Snake) -> None: guild = await bot.fetch_guild(follow.guild) channel = await bot.fetch_channel(follow.channel) if not guild or not channel: - logger.debug(f"Follow {follow.id} no longer valid, deleting") + logger.debug(f"Follow {follow.id} invalid, deleting") await follow.delete() count -= 1 continue @@ -183,7 +183,9 @@ async def reddit(bot: Snake) -> None: logger.debug(f"Subreddit {sub.display_name} has no followers, removing") await sub.delete() + old_count = 0 while True: + count = len(running) subs = Subreddit.find(q(display_name__nin=running)) # Go through all actively followed subreddits @@ -214,6 +216,10 @@ async def reddit(bot: Snake) -> None: # Create and run stream coro = _stream(sub, bot) asyncio.create_task(coro) + count += 1 + if old_count != count: + logger.debug(f"Now streaming {count} subreddits") + old_count = count # Check every 60 seconds await asyncio.sleep(60)