(
scheduleId: string,
requestId: string,
now: Date,
context: string,
nextRunAt?: Date | null,
options: { expectedLastQueuedAt?: Date | null } = {}
)
| 162 | } |
| 163 | |
| 164 | export 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 | |
| 184 | function getScheduleClaimedAt(payload: ScheduleExecutionPayload): Date | null { |
| 185 | const claimedAt = new Date(payload.now) |
no test coverage detected