docs(cron): explain why the secret-scope reset must stay function-level

Review follow-up: the comment records that the reset scopes delivery,
deferred-agent teardown, claim-loss handling and bookkeeping, and that an
earlier inner-finally placement left _deliver_result unscoped — so a
tidy-up does not silently reintroduce the bug.
This commit is contained in:
ghosty93
2026-08-23 15:08:21 +03:00
committed by Teknium
parent 07f6518b6d
commit b8c18b8cb7
+4
View File
@@ -7618,6 +7618,10 @@ def _run_one_job_body(
raise
return False
finally:
# Function-level on purpose: this must scope delivery, deferred-agent
# teardown, claim-loss handling and bookkeeping, not just run_job.
# An earlier revision reset inside the run block's finally, which left
# _deliver_result unscoped — do not move it back in a tidy-up.
if _scope_token is not None:
reset_secret_scope(_scope_token)