(client, command)
| 387 | const temp = `${target}.${process.pid}.${Date.now()}.tmp` |
| 388 | try { |
| 389 | await fs.writeFile(temp, JSON.stringify({ version: 4, jobs: state.jobs || [] }, null, 2)) |
| 390 | await fs.rename(temp, target) |
| 391 | } finally { |
| 392 | try { await fs.rm(temp, { force: true }) } catch {} |
| 393 | } |
| 394 | }) |
| 395 | } |
| 396 | |
| 397 | async function removeState(directory, sessionID) { |
| 398 | await withStateWriteLock(directory, sessionID, async () => { |
| 399 | try { await fs.unlink(statePath(directory, sessionID)) } catch {} |
no test coverage detected