release lock on boot
This commit is contained in:
parent
c0323b4b29
commit
d1809b9b51
2
main.py
2
main.py
@ -24,6 +24,7 @@ dp = Dispatcher(bot)
|
|||||||
|
|
||||||
|
|
||||||
async def check_updates():
|
async def check_updates():
|
||||||
|
|
||||||
async with redis.lock('e621:update'):
|
async with redis.lock('e621:update'):
|
||||||
tag_list = [t.decode() for t in await redis.smembers('e621:subs')]
|
tag_list = [t.decode() for t in await redis.smembers('e621:subs')]
|
||||||
tag_list.sort()
|
tag_list.sort()
|
||||||
@ -130,6 +131,7 @@ async def update(msg: Message):
|
|||||||
|
|
||||||
|
|
||||||
async def background_on_start():
|
async def background_on_start():
|
||||||
|
await redis.lock('e621:update').release()
|
||||||
while True:
|
while True:
|
||||||
await check_updates()
|
await check_updates()
|
||||||
await asyncio.sleep(60)
|
await asyncio.sleep(60)
|
||||||
|
Loading…
Reference in New Issue
Block a user