fix tag count limit

This commit is contained in:
bakatrouble 2023-03-24 17:25:28 +03:00
parent 547132d5d6
commit 3bee7c0bc2

View File

@ -23,7 +23,8 @@ 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')]
tags = ' '.join(f'~{tag}' for tag in tag_list) for tl_idx in range(0, len(tag_list), 40):
tags = ' '.join(f'~{tag}' for tag in tag_list[tl_idx: tl_idx + 40])
posts = await e621.get_posts(tags) posts = await e621.get_posts(tags)
if not posts: if not posts:
return return