Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/2 hour backfill #84

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ N_GSPS: The number of gsps you want to pull
INCLUDE_NATIONAL: Option to load national data, or not
UK_LONDON_HOUR: Optional to check UK London hour. This means can run this service at the same
UTC times, independently of the clock change.
BACKFILL_HOURS: Optional, defaults to 2. The amount of hours of data that is backfilled.

These options can also be enter like this:
```
Expand Down
3 changes: 2 additions & 1 deletion gspconsumer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def pull_data_and_save(
datetime_utc = datetime.utcnow().replace(tzinfo=timezone.utc) # add timezone

if regime == "in-day":
start = datetime_utc - timedelta(hours=1)
backfill_hours = os.getenv("BACKFILL_HOURS", 2)
start = datetime_utc - timedelta(hours=backfill_hours)
end = datetime_utc + timedelta(minutes=30)
else:
start = datetime_utc.replace(hour=0, minute=0, second=0, microsecond=0) - timedelta(
Expand Down
Loading