Skip to content

Commit

Permalink
chore(data-warehouse): add temporal schedule offset (#19056)
Browse files Browse the repository at this point in the history
add temporal schedule offset
  • Loading branch information
EDsCODE authored Dec 4, 2023
1 parent c92b25b commit b62e3be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion posthog/warehouse/data_load/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ def sync_external_data_job_workflow(external_data_source: ExternalDataSource, cr
id=str(external_data_source.pk),
task_queue=DATA_WAREHOUSE_TASK_QUEUE,
),
spec=ScheduleSpec(intervals=[ScheduleIntervalSpec(every=timedelta(hours=24))]),
spec=ScheduleSpec(
intervals=[
ScheduleIntervalSpec(
every=timedelta(hours=24), offset=timedelta(hours=external_data_source.created_at.hour)
)
],
jitter=timedelta(hours=2),
),
state=ScheduleState(note=f"Schedule for external data source: {external_data_source.pk}"),
policy=SchedulePolicy(overlap=ScheduleOverlapPolicy.CANCEL_OTHER),
)
Expand Down

0 comments on commit b62e3be

Please sign in to comment.