From 10b15da684711f2cf288da2daff5a74302a7f97a Mon Sep 17 00:00:00 2001 From: Richard Roberson Date: Sun, 12 Jan 2025 11:35:25 -0700 Subject: [PATCH] hydrate posts from only 4 days --- firehose/db_scheduler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/firehose/db_scheduler.py b/firehose/db_scheduler.py index d8de879..b5ae8f8 100644 --- a/firehose/db_scheduler.py +++ b/firehose/db_scheduler.py @@ -70,7 +70,7 @@ def hydrate_posts_with_interactions(client: Client, batch_size: int = 25, schedu with db.connection_context(): logger.info("Hydration Database connection opened.") # get posts with uri and interactions from the last 7 days - posts = Post.select(Post.uri, Post.interactions).where(Post.indexed_at > (datetime.now() - timedelta(days=7))) + posts = Post.select(Post.uri, Post.interactions).where(Post.indexed_at > (datetime.now() - timedelta(days=4))) uris = [post.uri for post in posts] if not uris: @@ -162,7 +162,6 @@ def hydrate_posts_with_interactions(client: Client, batch_size: int = 25, schedu try: with db.atomic(): updated = Post.bulk_update(posts_to_update, fields=['interactions']) - logger.info(f"Hydrated {updated} posts with updated hot_scores.") except Exception as e: logger.error(f"Failed to bulk update posts: {e}")