(dir?: string)
| 51 | } |
| 52 | |
| 53 | async function readLock(dir?: string): Promise<SchedulerLock | undefined> { |
| 54 | let raw: string |
| 55 | try { |
| 56 | raw = await readFile(getLockPath(dir), 'utf8') |
| 57 | } catch { |
| 58 | return undefined |
| 59 | } |
| 60 | const result = schedulerLockSchema().safeParse(safeParseJSON(raw, false)) |
| 61 | return result.success ? result.data : undefined |
| 62 | } |
| 63 | |
| 64 | async function tryCreateExclusive( |
| 65 | lock: SchedulerLock, |
no test coverage detected