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