|
| 1 | +--- |
| 2 | +"@vorsteh-queue/core": minor |
| 3 | +"@vorsteh-queue/adapter-drizzle": minor |
| 4 | +"@vorsteh-queue/adapter-prisma": minor |
| 5 | +--- |
| 6 | + |
| 7 | +Add configurable job timeouts and rename `processingInterval` to `pollInterval`. |
| 8 | + |
| 9 | +**New Features:** |
| 10 | + |
| 11 | +- **Configurable job timeouts**: Set `timeout: number` for specific timeout or `timeout: false` to disable timeout completely |
| 12 | +- **Job-specific timeout override**: Individual jobs can override queue default timeout settings |
| 13 | +- **Timeout field storage**: Job timeout configuration is now stored in job records for proper handling |
| 14 | + |
| 15 | +**Breaking Changes:** |
| 16 | + |
| 17 | +- **Renamed `processingInterval` to `pollInterval`**: More accurately describes the interval between queue polling cycles |
| 18 | +- **Database schema changes**: Added `timeout` column to queue_jobs table (JSONB field, nullable) |
| 19 | + |
| 20 | +**Migration Guide:** |
| 21 | + |
| 22 | +```typescript |
| 23 | +// Before |
| 24 | +const queue = new Queue(adapter, { |
| 25 | + name: "my-queue", |
| 26 | + processingInterval: 1000, // OLD |
| 27 | +}) |
| 28 | + |
| 29 | +// After |
| 30 | +const queue = new Queue(adapter, { |
| 31 | + name: "my-queue", |
| 32 | + pollInterval: 1000, // NEW |
| 33 | +}) |
| 34 | + |
| 35 | +// New timeout features |
| 36 | +await queue.add("long-job", payload, { timeout: false }) // Disable timeout |
| 37 | +await queue.add("quick-job", payload, { timeout: 5000 }) // 5 second timeout |
| 38 | +``` |
| 39 | + |
| 40 | +**Database Migration Required:** |
| 41 | + |
| 42 | +- **Drizzle users**: Run migrations to add `timeout` column |
| 43 | +- **Prisma users**: Run `prisma db push` or `prisma migrate` to apply schema changes |
| 44 | + |
| 45 | +**Examples:** |
| 46 | + |
| 47 | +```typescript |
| 48 | +// Disable timeout for long-running data processing |
| 49 | +await queue.add("process-large-dataset", data, { timeout: false }) |
| 50 | + |
| 51 | +// Set specific timeout for API calls |
| 52 | +await queue.add("external-api-call", params, { timeout: 30000 }) |
| 53 | + |
| 54 | +// Use default timeout (30 seconds) - no change needed |
| 55 | +await queue.add("normal-job", payload) |
| 56 | +``` |
| 57 | + |
| 58 | +This release improves queue configuration clarity and provides flexible timeout control for different job types. |
0 commit comments