diff --git a/main.py b/main.py index 0b7c5ba..f26caf1 100644 --- a/main.py +++ b/main.py @@ -24,6 +24,7 @@ dp = Dispatcher(bot) async def check_updates(): + async with redis.lock('e621:update'): tag_list = [t.decode() for t in await redis.smembers('e621:subs')] tag_list.sort() @@ -130,6 +131,7 @@ async def update(msg: Message): async def background_on_start(): + await redis.lock('e621:update').release() while True: await check_updates() await asyncio.sleep(60)