Skip to content

Commit

Permalink
Change scheduling buffering policies and ID format
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Sep 5, 2024
1 parent 70c0a3c commit 49cd001
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oonipipeline/src/oonipipeline/temporal/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def schedule_observations(
print("WARNING: multiple schedules detected")
return existing_schedules

ts = datetime.now(timezone.utc).strftime("%Y%m%d%H%M%S")
ts = datetime.now(timezone.utc).strftime("%y.%m.%d_%H%M%S")
schedule_id = f"{base_schedule_id}-{ts}"

await client.create_schedule(
Expand All @@ -86,7 +86,7 @@ async def schedule_observations(
)
],
),
policy=SchedulePolicy(overlap=ScheduleOverlapPolicy.TERMINATE_OTHER),
policy=SchedulePolicy(overlap=ScheduleOverlapPolicy.BUFFER_ALL),
state=ScheduleState(
note="Run the observations workflow every day with an offset of 2 hours to ensure the files have been written to s3"
),
Expand Down Expand Up @@ -123,7 +123,7 @@ async def schedule_analysis(
# re-scheduling it. Not doing so will mean that temporal will believe the
# workflow has already been execututed and will refuse to re-run it.
# TODO(art): check if there is a more idiomatic way of implementing this
ts = datetime.now(timezone.utc).strftime("%Y%m%d%H%M%S")
ts = datetime.now(timezone.utc).strftime("%y.%m.%d_%H%M%S")
schedule_id = f"{base_schedule_id}-{ts}"

await client.create_schedule(
Expand Down

0 comments on commit 49cd001

Please sign in to comment.