more logging

This commit is contained in:
bakatrouble 2023-11-03 15:50:08 +03:00
parent 9be1e34d1f
commit 1821645b88

View File

@ -119,7 +119,7 @@ async def send_post(post: E621Post, tag_list: List[str]):
except Exception as e: except Exception as e:
logging.exception(e) logging.exception(e)
else: else:
logging.warning('Not sending because url is None', post) logging.warning('Not sending because url is None', post.file)
except Exception as e: except Exception as e:
logging.exception(e) logging.exception(e)
@ -133,9 +133,7 @@ async def check_updates():
for tl_idx in range(0, len(tag_list), 40): for tl_idx in range(0, len(tag_list), 40):
tags = ' '.join(f'~{tag}' for tag in tag_list[tl_idx: tl_idx + 40]) tags = ' '.join(f'~{tag}' for tag in tag_list[tl_idx: tl_idx + 40])
logging.warning(tags) logging.warning(tags)
posts = [] posts = await e621.get_posts(tags)
for page in range(1, 2):
posts.extend(await e621.get_posts(tags, page))
if not posts: if not posts:
return return
already_sent: List = await redis.smismember('e621:sent', [p.id for p in posts]) already_sent: List = await redis.smismember('e621:sent', [p.id for p in posts])