Skip to content

Commit 72d8a68

Browse files
committed
address comments
1 parent d97f27e commit 72d8a68

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/sim/lib/core/workspace-dispatch/redis-store.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ export class RedisWorkspaceDispatchStorage implements WorkspaceDispatchStorageAd
336336
case WORKSPACE_DISPATCH_CLAIM_RESULTS.ADMITTED: {
337337
const record = await this.getDispatchJobRecord(lua.jobId!)
338338
if (!record) {
339-
throw new Error(`Claimed job ${lua.jobId} not found in store`)
339+
await this.redis.zrem(workspaceLeaseKey(workspaceId), lua.leaseId!).catch(() => undefined)
340+
logger.warn('Claimed job record expired before status update, lease released', {
341+
jobId: lua.jobId,
342+
})
343+
return { type: WORKSPACE_DISPATCH_CLAIM_RESULTS.EMPTY }
340344
}
341345

342346
const updatedRecord: WorkspaceDispatchJobRecord = {

0 commit comments

Comments
 (0)