(key: string, ttlMs: number)
| 35 | } |
| 36 | |
| 37 | shouldRun(key: string, ttlMs: number): Promise<boolean> { |
| 38 | const reqId = createID(); |
| 39 | return new Promise<boolean>((resolve, reject) => { |
| 40 | this.pending.set(reqId, (result) => { |
| 41 | // The parent reports a coordinator error by replying with `error`; reject |
| 42 | // so the runner fails closed (skips the run), mirroring the inline path. |
| 43 | if (result.error) reject(new Error(result.error)); |
| 44 | else resolve(result.allowed); |
| 45 | }); |
| 46 | this.channel.send?.({ type: 'coordinator:shouldRun', key, ttlMs, reqId }); |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | onComplete(key: string): Promise<void> { |
| 51 | this.channel.send?.({ type: 'coordinator:complete', key }); |
nothing calls this directly
no test coverage detected