MCPcopy
hub / github.com/simstudioai/sim / releaseScheduleLock

Function releaseScheduleLock

apps/sim/background/schedule-execution.ts:164–182  ·  view source on GitHub ↗
(
  scheduleId: string,
  requestId: string,
  now: Date,
  context: string,
  nextRunAt?: Date | null,
  options: { expectedLastQueuedAt?: Date | null } = {}
)

Source from the content-addressed store, hash-verified

162}
163
164export async function releaseScheduleLock(
165 scheduleId: string,
166 requestId: string,
167 now: Date,
168 context: string,
169 nextRunAt?: Date | null,
170 options: { expectedLastQueuedAt?: Date | null } = {}
171): Promise<boolean> {
172 const updates: WorkflowScheduleUpdate = {
173 updatedAt: now,
174 lastQueuedAt: null,
175 }
176
177 if (nextRunAt) {
178 updates.nextRunAt = nextRunAt
179 }
180
181 return applyScheduleUpdate(scheduleId, updates, requestId, context, options)
182}
183
184function getScheduleClaimedAt(payload: ScheduleExecutionPayload): Date | null {
185 const claimedAt = new Date(payload.now)

Callers 5

processScheduleItemFunction · 0.90
processJobItemFunction · 0.90
releaseClaimFunction · 0.85
executeJobInlineFunction · 0.85

Calls 1

applyScheduleUpdateFunction · 0.85

Tested by

no test coverage detected