From eead6033e2b5d5da03dc7dfc5831aabdeae73b3d Mon Sep 17 00:00:00 2001 From: chelsea Date: Sat, 11 Oct 2025 18:23:43 -0500 Subject: [PATCH] Fix polling to use 24-hour window instead of resume feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Polling now always collects posts from last 24 hours - Removes resume feature that created too-narrow time windows - Fixes issue where polls returned 0 posts due to minutes-wide ranges 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- polling_service.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/polling_service.py b/polling_service.py index 3175fd0..543c37e 100644 --- a/polling_service.py +++ b/polling_service.py @@ -145,15 +145,20 @@ class PollingService: Collect data from a source. Wraps the existing data_collection.py functionality. """ - from data_collection import ensure_directories, load_index, save_index, calculate_date_range, load_state, save_state + from data_collection import ensure_directories, load_index, save_index, load_state, save_state + from datetime import datetime, timedelta # Setup directories and load state dirs = ensure_directories(self.storage_dir) index = load_index(self.storage_dir) state = load_state(self.storage_dir) - # Calculate date range (collect last 1 day) - start_iso, end_iso = calculate_date_range(1, state) + # Calculate date range - always use last 24 hours for polling + # Don't use the resume feature as it can create too narrow windows + end_date = datetime.now() + start_date = end_date - timedelta(hours=24) + start_iso = start_date.isoformat() + end_iso = end_date.isoformat() try: # Call the existing collect_platform function