Kind: Class
Source: atloria-monorepo/packages/doc-automation/src/v2/pipeline/checkpoint.ts
Methods
| Method | Signature | Returns |
|---|---|---|
save | save(jobState: JobState, stageData: Record<string, unknown>) | Promise<string> |
load | load(jobId: string) | `Promise<CheckpointData |
exists | exists(jobId: string) | Promise<boolean> |
delete | delete(jobId: string) | Promise<void> |
startAutoSave | startAutoSave(getState: () => { jobState: JobState; stageData: Record<string, unknown> }) | void |
stopAutoSave | stopAutoSave() | void |
listJobs | listJobs() | Promise<string[]> |
getHistory | getHistory(jobId: string) | Promise<{ path: string; timestamp: Date }[]> |
Where it refuses work
CheckpointServicestops the work with an early return when(error as NodeJS.ErrnoException).code === 'ENOENT'.CheckpointServicestops the work with an early return whenfiles.length <= this.config.maxCheckpoints.CheckpointServicestops the work with an early return whenthis.config.autoSaveInterval <= 0.
When something fails
CheckpointServicehandles failure in 10 places: it discards it silently in 4, turns it into a return value in 3, lets it reach the caller in 2, and logs it and continues in 1.
Was this page helpful?