Skip to content

Commit

Permalink
Only request profiles 12 hours after day has passed
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Dec 27, 2023
1 parent 2203f45 commit edb9d4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/profiles/generate_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/profiles/std_site_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit edb9d4f

Please sign in to comment.