Skip to content

Commit

Permalink
Issue/2 hour backfill (#84)
Browse files Browse the repository at this point in the history
* use docker compose

* 2 hours of backfill

* add to readme

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
peterdudfield and pre-commit-ci[bot] authored Sep 17, 2024
1 parent 15f82bb commit 224d97b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 224d97b

Please sign in to comment.