From edb9d4ff62087cbdfa36f8136fbac68b1ae41ad2 Mon Sep 17 00:00:00 2001 From: Moritz Makowski Date: Wed, 27 Dec 2023 09:11:53 +0000 Subject: [PATCH] Only request profiles 12 hours after day has passed --- src/profiles/generate_queries.py | 3 ++- src/profiles/std_site_logic.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/profiles/generate_queries.py b/src/profiles/generate_queries.py index d2c4dd94..3ca60031 100644 --- a/src/profiles/generate_queries.py +++ b/src/profiles/generate_queries.py @@ -113,7 +113,8 @@ def list_requested_data( to_date = min( config.profiles.scope.to_date, sensor_location.to_datetime.date(), - datetime.date.today() - datetime.timedelta(days=1), + (datetime.datetime.utcnow() - + datetime.timedelta(hours=12)).date(), ) if from_date <= to_date: requested_data[l].update( diff --git a/src/profiles/std_site_logic.py b/src/profiles/std_site_logic.py index 8c5ffcf7..d4f4fee0 100644 --- a/src/profiles/std_site_logic.py +++ b/src/profiles/std_site_logic.py @@ -15,7 +15,7 @@ def list_requested_data( from_date = std_site_config.from_date to_date = min( std_site_config.to_date, - datetime.date.today() - datetime.timedelta(days=1), + (datetime.datetime.utcnow() - datetime.timedelta(hours=12)).date(), ) if from_date > to_date: return set()