Skip logging posts that were sent in past

This commit is contained in:
Zeva Rose 2022-04-21 10:12:31 -06:00
parent 5c242e3428
commit da2445f04f

View file

@ -102,9 +102,9 @@ async def _stream(sub: Sub, bot: Snake) -> None:
if not post: if not post:
logger.debug(f"Got None for post in {sub.display_name}") logger.debug(f"Got None for post in {sub.display_name}")
continue continue
logger.debug(f"Got new post in {sub.display_name}")
if post.created_utc < now.timestamp(): if post.created_utc < now.timestamp():
continue continue
logger.debug(f"Got new post in {sub.display_name}")
follows = SubredditFollow.find(q(display_name=sub.display_name)) follows = SubredditFollow.find(q(display_name=sub.display_name))
follows_to_delete = [] follows_to_delete = []
num_follows = 0 num_follows = 0