@psyqueue/plugin-crash-recovery
v0.1.0
Published
> WAL-based crash recovery for PsyQueue. Automatically requeue orphaned jobs after a process crash.
Readme
@psyqueue/plugin-crash-recovery
WAL-based crash recovery for PsyQueue. Automatically requeue orphaned jobs after a process crash.
Installation
npm install @psyqueue/plugin-crash-recoveryUsage
import { crashRecovery } from '@psyqueue/plugin-crash-recovery'
q.use(crashRecovery({
walPath: './psyqueue.wal',
autoRecover: true,
onRecoverActiveJob: 'requeue',
}))Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| walPath | string | './psyqueue.wal' | Write-ahead log file path |
| autoRecover | boolean | true | Auto-recover on start |
| onRecoverActiveJob | 'requeue' \| 'fail' \| Function | 'requeue' | Recovery strategy |
| shutdownTimeout | number | 30000 | Max shutdown wait time (ms) |
Depends on: backend
Exports
crashRecovery(opts?)-- Plugin factoryWriteAheadLog-- WAL classrecoverFromWal-- Recovery function
Documentation
See Reliability Plugins for detailed usage.
License
MIT
