Skip to content

Commit 24f891b

Browse files
committed
Fix scheduling bug in distribution status check
1 parent 62d14ea commit 24f891b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

atr/tasks/distribution.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,12 @@ async def status_check(args: DistributionStatusCheckArgs, *, task_id: int | None
7777
except (distribution.DistributionError, storage.AccessError) as e:
7878
msg = f"Failed to record distribution: {e}"
7979
log.error(msg)
80-
finally:
81-
if args.next_schedule_seconds:
82-
next_schedule = datetime.datetime.now(datetime.UTC) + datetime.timedelta(
83-
seconds=args.next_schedule_seconds
84-
)
85-
await tasks.distribution_status_check(args.asf_uid, schedule=next_schedule, schedule_next=True)
86-
log.info(
87-
f"Scheduled next workflow status update for: {next_schedule.strftime('%Y-%m-%d %H:%M:%S')}",
88-
)
80+
if args.next_schedule_seconds:
81+
next_schedule = datetime.datetime.now(datetime.UTC) + datetime.timedelta(seconds=args.next_schedule_seconds)
82+
await tasks.distribution_status_check(args.asf_uid, schedule=next_schedule, schedule_next=True)
83+
log.info(
84+
f"Scheduled next workflow status update for: {next_schedule.strftime('%Y-%m-%d %H:%M:%S')}",
85+
)
8986
return results.DistributionStatusCheck(
9087
kind="distribution_status",
9188
)

0 commit comments

Comments
 (0)