Skip to content

Commit 33c0138

Browse files
chore(rate-limiter): trim verbose comments
1 parent fb311b5 commit 33c0138

3 files changed

Lines changed: 8 additions & 17 deletions

File tree

apps/sim/background/workflow-column-execution.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ export async function executeWorkflowGroupCellJob(
7070
...currentPayload,
7171
groupId: next.id,
7272
workflowId: next.workflowId,
73-
// Re-derive from the target group rather than inheriting the prior group's
74-
// value via the spread: a workflow group following an enrichment group would
75-
// otherwise carry a stale enrichmentId.
73+
// Re-derive so a workflow group after an enrichment group doesn't keep a stale enrichmentId.
7674
enrichmentId: next.enrichmentId,
7775
executionId: generateId(),
7876
}

apps/sim/lib/core/rate-limiter/hosted-key/hosted-key-rate-limiter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ function interruptibleSleep(ms: number, signal?: AbortSignal): Promise<void> {
7373
resolve()
7474
}, ms)
7575
signal.addEventListener('abort', onAbort, { once: true })
76-
// Re-check after registering: if the signal fired between the guard above and
77-
// addEventListener, the 'abort' event already dispatched and our listener would
78-
// never run, leaving the sleep to run its full duration. onAbort is idempotent.
76+
// Catch an abort that fired between the guard above and addEventListener.
7977
if (signal.aborted) onAbort()
8078
})
8179
}

apps/sim/lib/core/rate-limiter/hosted-key/queue.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ const TICKET_HEARTBEAT_TTL_SECONDS = 30
1515
export const HEARTBEAT_REFRESH_INTERVAL_MS = 10_000
1616

1717
/**
18-
* TTL on the queue list itself. Set on every enqueue and re-extended by the head's
19-
* heartbeat while it actively waits, so a long-waiting head (whose budget can exceed
20-
* this TTL for enterprise async runs) never lets the list expire out from under the
21-
* waiters behind it. Prevents abandoned queues (whole workspace went silent) from
22-
* sticking around forever in Redis.
18+
* TTL on the queue list itself. Set on enqueue and re-extended by the head's heartbeat,
19+
* so a long-waiting head can't let the list expire out from under the waiters behind it.
20+
* Prevents abandoned queues from sticking around forever in Redis.
2321
*/
2422
const QUEUE_LIST_TTL_SECONDS = 600
2523

@@ -150,12 +148,9 @@ export class HostedKeyQueue {
150148
}
151149

152150
/**
153-
* Refresh the ticket's heartbeat. Called periodically by the head while it's
154-
* waiting on the bucket so it doesn't get reaped as dead. Also re-extends the
155-
* queue list TTL: a head whose wait outlives {@link QUEUE_LIST_TTL_SECONDS}
156-
* (possible for long enterprise async budgets) would otherwise let the list
157-
* expire with no new enqueue to refresh it, dropping every waiter to "missing"
158-
* and collapsing FIFO ordering into concurrent bucket racing.
151+
* Refresh the ticket's heartbeat so the head isn't reaped as dead while waiting on the
152+
* bucket. Also re-extends the queue list TTL so a wait outliving {@link QUEUE_LIST_TTL_SECONDS}
153+
* doesn't let the list expire and collapse FIFO ordering.
159154
*/
160155
async refreshHeartbeat(
161156
provider: string,

0 commit comments

Comments
 (0)