From d1809b9b515300908449a7f467762d669ac5c835 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 30 Mar 2023 22:37:33 +0300 Subject: [PATCH] release lock on boot --- main.py | 2 ++ 1 file changed, 2 insertions(+) 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)