Skip to content

Commit c5c8646

Browse files
committed
docs: correct stale references to workflowInfo().startTime in comments
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
1 parent ea84fef commit c5c8646

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

services/apps/security_best_practices_worker/src/activities/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export async function saveOSPSBaselineInsightsToRedis(
190190
function classifyTokenError(output: string, source: string): void {
191191
// Wall-clock timestamp of the failure. Passed via ApplicationFailure.details so the
192192
// workflow can persist an accurate rateLimitedAt — workflow code can't call Date.now()
193-
// itself (Temporal determinism rule; workflowInfo().startTime skews on long batches).
193+
// directly (Temporal determinism rule).
194194
const failedAtMs = Date.now()
195195

196196
if (output.includes('401 Unauthorized') || output.includes('401 Bad credentials')) {

services/apps/security_best_practices_worker/src/workflows/triggerSecurityInsightsCheckForRepos.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ export async function triggerSecurityInsightsCheckForRepos(
117117
const appFailure = unwrapApplicationFailure(error)
118118
if (appFailure?.type === 'Token403Error') {
119119
tokenInfo.isRateLimited = true
120-
// Activity captures the wall-clock time of the 403 in details[0]; fall back to the
121-
// batch startTime when details are missing so we still record something.
120+
// Activity captures the wall-clock time of the 403 in details[0]; fall back to
121+
// the iteration's currentTimeMs (from the getCurrentTimeMs activity) so we still
122+
// record something when details are missing.
122123
tokenInfo.rateLimitedAt =
123124
extractFailureTimestamp(appFailure) ?? new Date(currentTimeMs).toISOString()
124125
sawRateLimit = true

0 commit comments

Comments
 (0)