File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
products/batch_exports/backend/temporal Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -172,8 +172,10 @@ async def backfill_schedule(inputs: BackfillScheduleInputs) -> None:
172172 settings .TEMPORAL_CLIENT_KEY ,
173173 )
174174
175- details = temporalio .activity .info ().heartbeat_details
175+ schedule_handle = client .get_schedule_handle (inputs .schedule_id )
176+ description = await schedule_handle .describe ()
176177
178+ details = temporalio .activity .info ().heartbeat_details
177179 if details :
178180 # If we receive details from a previous run, it means we were restarted for some reason.
179181 # Let's not double-backfill and instead wait for any outstanding runs.
@@ -195,9 +197,10 @@ async def backfill_schedule(inputs: BackfillScheduleInputs) -> None:
195197
196198 start_at = dt .datetime .fromisoformat (last_activity_details .last_batch_data_interval_end )
197199
198- schedule_handle = client .get_schedule_handle (inputs .schedule_id )
200+ if description .schedule .spec .time_zone_name and description .schedule .spec .time_zone_name != "UTC" :
201+ # Details is always in UTC, we must re-convert it to the schedule's timezone
202+ start_at = start_at .astimezone (zoneinfo .ZoneInfo (description .schedule .spec .time_zone_name ))
199203
200- description = await schedule_handle .describe ()
201204 frequency = dt .timedelta (seconds = inputs .frequency_seconds )
202205
203206 if start_at is not None :
You can’t perform that action at this time.
0 commit comments