bunqueue 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -11
- package/dist/application/backgroundTasks.d.ts +0 -1
- package/dist/application/backgroundTasks.js +83 -1
- package/dist/application/cleanupTasks.d.ts +0 -1
- package/dist/application/cleanupTasks.js +0 -1
- package/dist/application/clientTracking.d.ts +23 -1
- package/dist/application/clientTracking.js +80 -26
- package/dist/application/contextFactory.d.ts +6 -1
- package/dist/application/contextFactory.js +7 -1
- package/dist/application/dependencyProcessor.d.ts +0 -1
- package/dist/application/dependencyProcessor.js +0 -1
- package/dist/application/dlqManager.d.ts +0 -1
- package/dist/application/dlqManager.js +5 -1
- package/dist/application/eventsManager.d.ts +0 -1
- package/dist/application/eventsManager.js +0 -1
- package/dist/application/jobLogsManager.d.ts +0 -1
- package/dist/application/jobLogsManager.js +0 -1
- package/dist/application/latencyTracker.d.ts +0 -1
- package/dist/application/latencyTracker.js +0 -1
- package/dist/application/lockManager.d.ts +1 -2
- package/dist/application/lockManager.js +1 -2
- package/dist/application/lockOperations.d.ts +0 -1
- package/dist/application/lockOperations.js +0 -1
- package/dist/application/metricsExporter.d.ts +0 -1
- package/dist/application/metricsExporter.js +0 -1
- package/dist/application/monitoringChecks.d.ts +0 -1
- package/dist/application/monitoringChecks.js +0 -1
- package/dist/application/operations/ack.d.ts +0 -1
- package/dist/application/operations/ack.js +32 -34
- package/dist/application/operations/ackHelpers.d.ts +0 -1
- package/dist/application/operations/ackHelpers.js +0 -1
- package/dist/application/operations/index.d.ts +0 -1
- package/dist/application/operations/index.js +0 -1
- package/dist/application/operations/jobManagement.d.ts +1 -2
- package/dist/application/operations/jobManagement.js +3 -3
- package/dist/application/operations/jobStateTransitions.d.ts +0 -1
- package/dist/application/operations/jobStateTransitions.js +0 -1
- package/dist/application/operations/pull.d.ts +0 -1
- package/dist/application/operations/pull.js +0 -1
- package/dist/application/operations/push.d.ts +0 -1
- package/dist/application/operations/push.js +0 -1
- package/dist/application/operations/queryOperations.d.ts +0 -1
- package/dist/application/operations/queryOperations.js +37 -4
- package/dist/application/operations/queueControl.d.ts +16 -5
- package/dist/application/operations/queueControl.js +119 -24
- package/dist/application/queueManager.d.ts +17 -4
- package/dist/application/queueManager.js +106 -28
- package/dist/application/stallDetection.d.ts +0 -1
- package/dist/application/stallDetection.js +1 -1
- package/dist/application/statsManager.d.ts +0 -1
- package/dist/application/statsManager.js +0 -1
- package/dist/application/taskErrorTracking.d.ts +0 -1
- package/dist/application/taskErrorTracking.js +0 -1
- package/dist/application/throughputTracker.d.ts +0 -1
- package/dist/application/throughputTracker.js +0 -1
- package/dist/application/types.d.ts +2 -2
- package/dist/application/types.js +0 -1
- package/dist/application/webhookManager.d.ts +0 -1
- package/dist/application/webhookManager.js +0 -1
- package/dist/application/workerManager.d.ts +0 -1
- package/dist/application/workerManager.js +0 -1
- package/dist/cli/client.d.ts +0 -1
- package/dist/cli/client.js +15 -3
- package/dist/cli/commands/backup.d.ts +0 -1
- package/dist/cli/commands/backup.js +0 -1
- package/dist/cli/commands/core.d.ts +0 -1
- package/dist/cli/commands/core.js +0 -1
- package/dist/cli/commands/cron.d.ts +0 -1
- package/dist/cli/commands/cron.js +0 -1
- package/dist/cli/commands/dlq.d.ts +0 -1
- package/dist/cli/commands/dlq.js +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -1
- package/dist/cli/commands/doctor.js +0 -1
- package/dist/cli/commands/job.d.ts +0 -1
- package/dist/cli/commands/job.js +0 -1
- package/dist/cli/commands/monitor.d.ts +0 -1
- package/dist/cli/commands/monitor.js +0 -1
- package/dist/cli/commands/queue.d.ts +0 -1
- package/dist/cli/commands/queue.js +0 -1
- package/dist/cli/commands/rateLimit.d.ts +0 -1
- package/dist/cli/commands/rateLimit.js +0 -1
- package/dist/cli/commands/server.d.ts +0 -1
- package/dist/cli/commands/server.js +0 -1
- package/dist/cli/commands/types.d.ts +0 -1
- package/dist/cli/commands/types.js +0 -1
- package/dist/cli/commands/webhook.d.ts +0 -1
- package/dist/cli/commands/webhook.js +0 -1
- package/dist/cli/commands/worker.d.ts +0 -1
- package/dist/cli/commands/worker.js +0 -1
- package/dist/cli/help.d.ts +0 -1
- package/dist/cli/help.js +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +31 -3
- package/dist/cli/output.d.ts +1 -2
- package/dist/cli/output.js +71 -10
- package/dist/client/bunqueue/aging.d.ts +0 -1
- package/dist/client/bunqueue/aging.js +0 -1
- package/dist/client/bunqueue/batch.d.ts +0 -1
- package/dist/client/bunqueue/batch.js +2 -3
- package/dist/client/bunqueue/cancellation.d.ts +0 -1
- package/dist/client/bunqueue/cancellation.js +0 -1
- package/dist/client/bunqueue/circuitBreaker.d.ts +0 -1
- package/dist/client/bunqueue/circuitBreaker.js +0 -1
- package/dist/client/bunqueue/dedupDebounce.d.ts +0 -1
- package/dist/client/bunqueue/dedupDebounce.js +0 -1
- package/dist/client/bunqueue/dlqRateLimit.d.ts +0 -1
- package/dist/client/bunqueue/dlqRateLimit.js +0 -1
- package/dist/client/bunqueue/retry.d.ts +0 -1
- package/dist/client/bunqueue/retry.js +0 -1
- package/dist/client/bunqueue/triggers.d.ts +0 -1
- package/dist/client/bunqueue/triggers.js +0 -1
- package/dist/client/bunqueue/ttl.d.ts +0 -1
- package/dist/client/bunqueue/ttl.js +0 -1
- package/dist/client/bunqueue/types.d.ts +0 -1
- package/dist/client/bunqueue/types.js +0 -1
- package/dist/client/bunqueue.d.ts +0 -1
- package/dist/client/bunqueue.js +3 -4
- package/dist/client/errors.d.ts +0 -1
- package/dist/client/errors.js +0 -1
- package/dist/client/events.d.ts +0 -1
- package/dist/client/events.js +0 -1
- package/dist/client/flow.d.ts +0 -1
- package/dist/client/flow.js +3 -2
- package/dist/client/flowJobFactory.d.ts +8 -2
- package/dist/client/flowJobFactory.js +328 -57
- package/dist/client/flowPush.d.ts +0 -1
- package/dist/client/flowPush.js +95 -47
- package/dist/client/flowTypes.d.ts +0 -1
- package/dist/client/flowTypes.js +0 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +0 -1
- package/dist/client/jobConversion.d.ts +0 -1
- package/dist/client/jobConversion.js +12 -5
- package/dist/client/jobConversionHelpers.d.ts +0 -1
- package/dist/client/jobConversionHelpers.js +0 -1
- package/dist/client/jobConversionTypes.d.ts +0 -1
- package/dist/client/jobConversionTypes.js +0 -1
- package/dist/client/jobHelpers.d.ts +0 -1
- package/dist/client/jobHelpers.js +0 -1
- package/dist/client/manager.d.ts +0 -1
- package/dist/client/manager.js +0 -1
- package/dist/client/queue/addBatcher.d.ts +0 -1
- package/dist/client/queue/addBatcher.js +0 -1
- package/dist/client/queue/bullmqCompat.d.ts +1 -1
- package/dist/client/queue/bullmqCompat.js +0 -1
- package/dist/client/queue/deduplication.d.ts +0 -1
- package/dist/client/queue/deduplication.js +0 -1
- package/dist/client/queue/dlq.d.ts +0 -1
- package/dist/client/queue/dlq.js +0 -1
- package/dist/client/queue/dlqOps.d.ts +0 -1
- package/dist/client/queue/dlqOps.js +0 -1
- package/dist/client/queue/helpers.d.ts +0 -1
- package/dist/client/queue/helpers.js +0 -1
- package/dist/client/queue/index.d.ts +0 -1
- package/dist/client/queue/index.js +0 -1
- package/dist/client/queue/jobMove.d.ts +0 -1
- package/dist/client/queue/jobMove.js +0 -1
- package/dist/client/queue/jobProxy.d.ts +22 -4
- package/dist/client/queue/jobProxy.js +347 -67
- package/dist/client/queue/operations/add.d.ts +1 -1
- package/dist/client/queue/operations/add.js +126 -30
- package/dist/client/queue/operations/control.d.ts +0 -1
- package/dist/client/queue/operations/control.js +0 -1
- package/dist/client/queue/operations/counts.d.ts +0 -1
- package/dist/client/queue/operations/counts.js +0 -1
- package/dist/client/queue/operations/index.d.ts +0 -1
- package/dist/client/queue/operations/index.js +0 -1
- package/dist/client/queue/operations/management.d.ts +1 -2
- package/dist/client/queue/operations/management.js +27 -10
- package/dist/client/queue/operations/query.d.ts +12 -1
- package/dist/client/queue/operations/query.js +44 -5
- package/dist/client/queue/queue.d.ts +0 -1
- package/dist/client/queue/queue.js +8 -2
- package/dist/client/queue/queueTypes.d.ts +0 -1
- package/dist/client/queue/queueTypes.js +0 -1
- package/dist/client/queue/rateLimit.d.ts +0 -1
- package/dist/client/queue/rateLimit.js +0 -1
- package/dist/client/queue/scheduler.d.ts +2 -1
- package/dist/client/queue/scheduler.js +28 -1
- package/dist/client/queue/stall.d.ts +0 -1
- package/dist/client/queue/stall.js +0 -1
- package/dist/client/queue/workers.d.ts +0 -1
- package/dist/client/queue/workers.js +0 -1
- package/dist/client/queue.d.ts +0 -1
- package/dist/client/queue.js +0 -1
- package/dist/client/queueGroup.d.ts +0 -1
- package/dist/client/queueGroup.js +0 -1
- package/dist/client/resolveToken.d.ts +0 -1
- package/dist/client/resolveToken.js +0 -1
- package/dist/client/sandboxed/index.d.ts +0 -1
- package/dist/client/sandboxed/index.js +0 -1
- package/dist/client/sandboxed/queueOps.d.ts +0 -1
- package/dist/client/sandboxed/queueOps.js +0 -1
- package/dist/client/sandboxed/types.d.ts +0 -1
- package/dist/client/sandboxed/types.js +0 -1
- package/dist/client/sandboxed/worker.d.ts +0 -1
- package/dist/client/sandboxed/worker.js +57 -16
- package/dist/client/sandboxed/wrapper.d.ts +0 -1
- package/dist/client/sandboxed/wrapper.js +62 -11
- package/dist/client/sandboxedWorker.d.ts +0 -1
- package/dist/client/sandboxedWorker.js +0 -1
- package/dist/client/tcp/client.d.ts +9 -1
- package/dist/client/tcp/client.js +84 -29
- package/dist/client/tcp/connection.d.ts +0 -1
- package/dist/client/tcp/connection.js +6 -2
- package/dist/client/tcp/health.d.ts +0 -1
- package/dist/client/tcp/health.js +0 -1
- package/dist/client/tcp/index.d.ts +0 -1
- package/dist/client/tcp/index.js +0 -1
- package/dist/client/tcp/reconnect.d.ts +0 -1
- package/dist/client/tcp/reconnect.js +0 -1
- package/dist/client/tcp/shared.d.ts +0 -1
- package/dist/client/tcp/shared.js +0 -1
- package/dist/client/tcp/types.d.ts +7 -1
- package/dist/client/tcp/types.js +0 -1
- package/dist/client/tcpClient.d.ts +0 -1
- package/dist/client/tcpClient.js +0 -1
- package/dist/client/tcpPool.d.ts +0 -1
- package/dist/client/tcpPool.js +0 -1
- package/dist/client/types.d.ts +8 -5
- package/dist/client/types.js +0 -1
- package/dist/client/worker/ackBatcher.d.ts +0 -1
- package/dist/client/worker/ackBatcher.js +18 -9
- package/dist/client/worker/groupConcurrency.d.ts +0 -1
- package/dist/client/worker/groupConcurrency.js +0 -1
- package/dist/client/worker/index.d.ts +0 -1
- package/dist/client/worker/index.js +0 -1
- package/dist/client/worker/jobParser.d.ts +0 -1
- package/dist/client/worker/jobParser.js +0 -1
- package/dist/client/worker/processor.d.ts +0 -1
- package/dist/client/worker/processor.js +54 -100
- package/dist/client/worker/processorHandlers.d.ts +54 -0
- package/dist/client/worker/processorHandlers.js +372 -0
- package/dist/client/worker/types.d.ts +0 -1
- package/dist/client/worker/types.js +0 -1
- package/dist/client/worker/worker.d.ts +0 -1
- package/dist/client/worker/worker.js +0 -1
- package/dist/client/worker/workerHeartbeat.d.ts +0 -1
- package/dist/client/worker/workerHeartbeat.js +0 -1
- package/dist/client/worker/workerPull.d.ts +0 -1
- package/dist/client/worker/workerPull.js +0 -1
- package/dist/client/worker/workerRateLimiter.d.ts +0 -1
- package/dist/client/worker/workerRateLimiter.js +0 -1
- package/dist/client/worker.d.ts +0 -1
- package/dist/client/worker.js +0 -1
- package/dist/client/workflow/compensator.d.ts +14 -0
- package/dist/client/workflow/compensator.js +45 -0
- package/dist/client/workflow/emitter.d.ts +0 -1
- package/dist/client/workflow/emitter.js +15 -4
- package/dist/client/workflow/engine.d.ts +8 -2
- package/dist/client/workflow/engine.js +9 -1
- package/dist/client/workflow/executor.d.ts +5 -3
- package/dist/client/workflow/executor.js +43 -61
- package/dist/client/workflow/index.d.ts +1 -2
- package/dist/client/workflow/index.js +0 -1
- package/dist/client/workflow/loops.d.ts +1 -2
- package/dist/client/workflow/loops.js +10 -2
- package/dist/client/workflow/recovery.d.ts +22 -0
- package/dist/client/workflow/recovery.js +73 -0
- package/dist/client/workflow/runner.d.ts +0 -1
- package/dist/client/workflow/runner.js +7 -6
- package/dist/client/workflow/store.d.ts +2 -1
- package/dist/client/workflow/store.js +6 -1
- package/dist/client/workflow/types.d.ts +41 -23
- package/dist/client/workflow/types.js +0 -1
- package/dist/client/workflow/workflow.d.ts +17 -15
- package/dist/client/workflow/workflow.js +30 -21
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/loader.d.ts +0 -1
- package/dist/config/loader.js +0 -1
- package/dist/config/resolve.d.ts +0 -1
- package/dist/config/resolve.js +0 -1
- package/dist/config/types.d.ts +0 -1
- package/dist/config/types.js +0 -1
- package/dist/domain/queue/dependencyTracker.d.ts +0 -1
- package/dist/domain/queue/dependencyTracker.js +0 -1
- package/dist/domain/queue/dlqShard.d.ts +0 -1
- package/dist/domain/queue/dlqShard.js +6 -1
- package/dist/domain/queue/index.d.ts +0 -1
- package/dist/domain/queue/index.js +0 -1
- package/dist/domain/queue/limiterManager.d.ts +0 -1
- package/dist/domain/queue/limiterManager.js +0 -1
- package/dist/domain/queue/priorityQueue.d.ts +2 -3
- package/dist/domain/queue/priorityQueue.js +5 -4
- package/dist/domain/queue/shard.d.ts +0 -1
- package/dist/domain/queue/shard.js +0 -1
- package/dist/domain/queue/shardCounters.d.ts +0 -1
- package/dist/domain/queue/shardCounters.js +0 -1
- package/dist/domain/queue/temporalManager.d.ts +0 -1
- package/dist/domain/queue/temporalManager.js +0 -1
- package/dist/domain/queue/uniqueKeyManager.d.ts +0 -1
- package/dist/domain/queue/uniqueKeyManager.js +0 -1
- package/dist/domain/queue/waiterManager.d.ts +0 -1
- package/dist/domain/queue/waiterManager.js +0 -1
- package/dist/domain/types/command.d.ts +22 -1
- package/dist/domain/types/command.js +0 -1
- package/dist/domain/types/cron.d.ts +21 -1
- package/dist/domain/types/cron.js +1 -1
- package/dist/domain/types/deduplication.d.ts +0 -1
- package/dist/domain/types/deduplication.js +0 -1
- package/dist/domain/types/dlq.d.ts +0 -1
- package/dist/domain/types/dlq.js +0 -1
- package/dist/domain/types/index.d.ts +0 -1
- package/dist/domain/types/index.js +0 -1
- package/dist/domain/types/job.d.ts +0 -1
- package/dist/domain/types/job.js +9 -3
- package/dist/domain/types/queue.d.ts +0 -1
- package/dist/domain/types/queue.js +0 -1
- package/dist/domain/types/response.d.ts +2 -1
- package/dist/domain/types/response.js +0 -1
- package/dist/domain/types/stall.d.ts +0 -1
- package/dist/domain/types/stall.js +0 -1
- package/dist/domain/types/webhook.d.ts +0 -1
- package/dist/domain/types/webhook.js +0 -1
- package/dist/domain/types/worker.d.ts +0 -1
- package/dist/domain/types/worker.js +0 -1
- package/dist/infrastructure/backup/index.d.ts +0 -1
- package/dist/infrastructure/backup/index.js +0 -1
- package/dist/infrastructure/backup/s3Backup.d.ts +0 -1
- package/dist/infrastructure/backup/s3Backup.js +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.d.ts +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.js +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.d.ts +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.js +44 -7
- package/dist/infrastructure/cloud/buffer.d.ts +0 -1
- package/dist/infrastructure/cloud/buffer.js +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.d.ts +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.js +0 -1
- package/dist/infrastructure/cloud/cloudAgent.d.ts +1 -2
- package/dist/infrastructure/cloud/cloudAgent.js +9 -12
- package/dist/infrastructure/cloud/commandHandler.d.ts +0 -1
- package/dist/infrastructure/cloud/commandHandler.js +0 -1
- package/dist/infrastructure/cloud/commands.d.ts +0 -1
- package/dist/infrastructure/cloud/commands.js +2 -3
- package/dist/infrastructure/cloud/config.d.ts +0 -1
- package/dist/infrastructure/cloud/config.js +0 -1
- package/dist/infrastructure/cloud/httpSender.d.ts +0 -1
- package/dist/infrastructure/cloud/httpSender.js +0 -1
- package/dist/infrastructure/cloud/index.d.ts +0 -1
- package/dist/infrastructure/cloud/index.js +0 -1
- package/dist/infrastructure/cloud/logger.d.ts +0 -1
- package/dist/infrastructure/cloud/logger.js +0 -1
- package/dist/infrastructure/cloud/redact.d.ts +10 -0
- package/dist/infrastructure/cloud/redact.js +21 -0
- package/dist/infrastructure/cloud/snapshotCollector.d.ts +4 -1
- package/dist/infrastructure/cloud/snapshotCollector.js +32 -18
- package/dist/infrastructure/cloud/snapshotHelpers.d.ts +9 -3
- package/dist/infrastructure/cloud/snapshotHelpers.js +10 -9
- package/dist/infrastructure/cloud/statsRefresh.d.ts +0 -1
- package/dist/infrastructure/cloud/statsRefresh.js +0 -1
- package/dist/infrastructure/cloud/statsUpdate.d.ts +0 -1
- package/dist/infrastructure/cloud/statsUpdate.js +0 -1
- package/dist/infrastructure/cloud/types.d.ts +0 -1
- package/dist/infrastructure/cloud/types.js +0 -1
- package/dist/infrastructure/cloud/wsSender.d.ts +0 -1
- package/dist/infrastructure/cloud/wsSender.js +0 -1
- package/dist/infrastructure/persistence/index.d.ts +0 -1
- package/dist/infrastructure/persistence/index.js +0 -1
- package/dist/infrastructure/persistence/schema.d.ts +2 -3
- package/dist/infrastructure/persistence/schema.js +16 -3
- package/dist/infrastructure/persistence/sqlite.d.ts +54 -2
- package/dist/infrastructure/persistence/sqlite.js +174 -3
- package/dist/infrastructure/persistence/sqliteBatch.d.ts +14 -1
- package/dist/infrastructure/persistence/sqliteBatch.js +29 -1
- package/dist/infrastructure/persistence/sqliteSerializer.d.ts +16 -1
- package/dist/infrastructure/persistence/sqliteSerializer.js +73 -9
- package/dist/infrastructure/persistence/statements.d.ts +2 -2
- package/dist/infrastructure/persistence/statements.js +3 -3
- package/dist/infrastructure/scheduler/cronParser.d.ts +0 -1
- package/dist/infrastructure/scheduler/cronParser.js +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.d.ts +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.js +19 -2
- package/dist/infrastructure/scheduler/index.d.ts +0 -1
- package/dist/infrastructure/scheduler/index.js +0 -1
- package/dist/infrastructure/server/handler.d.ts +0 -1
- package/dist/infrastructure/server/handler.js +0 -1
- package/dist/infrastructure/server/handlerRoutes.d.ts +0 -1
- package/dist/infrastructure/server/handlerRoutes.js +0 -1
- package/dist/infrastructure/server/handlers/advanced.d.ts +7 -2
- package/dist/infrastructure/server/handlers/advanced.js +41 -11
- package/dist/infrastructure/server/handlers/core.d.ts +0 -1
- package/dist/infrastructure/server/handlers/core.js +8 -1
- package/dist/infrastructure/server/handlers/cron.d.ts +0 -1
- package/dist/infrastructure/server/handlers/cron.js +1 -1
- package/dist/infrastructure/server/handlers/dashboard.d.ts +0 -1
- package/dist/infrastructure/server/handlers/dashboard.js +1 -1
- package/dist/infrastructure/server/handlers/dlq.d.ts +0 -1
- package/dist/infrastructure/server/handlers/dlq.js +0 -1
- package/dist/infrastructure/server/handlers/index.d.ts +0 -1
- package/dist/infrastructure/server/handlers/index.js +0 -1
- package/dist/infrastructure/server/handlers/management.d.ts +1 -2
- package/dist/infrastructure/server/handlers/management.js +27 -13
- package/dist/infrastructure/server/handlers/monitoring.d.ts +0 -1
- package/dist/infrastructure/server/handlers/monitoring.js +0 -1
- package/dist/infrastructure/server/handlers/query.d.ts +0 -1
- package/dist/infrastructure/server/handlers/query.js +0 -1
- package/dist/infrastructure/server/http.d.ts +0 -1
- package/dist/infrastructure/server/http.js +0 -1
- package/dist/infrastructure/server/httpEndpoints.d.ts +0 -1
- package/dist/infrastructure/server/httpEndpoints.js +0 -1
- package/dist/infrastructure/server/httpRouteJobs.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteJobs.js +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.js +0 -1
- package/dist/infrastructure/server/httpRouteQueues.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteQueues.js +0 -1
- package/dist/infrastructure/server/httpRouteResources.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteResources.js +0 -1
- package/dist/infrastructure/server/index.d.ts +0 -1
- package/dist/infrastructure/server/index.js +0 -1
- package/dist/infrastructure/server/protocol.d.ts +4 -1
- package/dist/infrastructure/server/protocol.js +17 -3
- package/dist/infrastructure/server/rateLimiter.d.ts +0 -1
- package/dist/infrastructure/server/rateLimiter.js +0 -1
- package/dist/infrastructure/server/socketWriteQueue.d.ts +66 -0
- package/dist/infrastructure/server/socketWriteQueue.js +126 -0
- package/dist/infrastructure/server/sseHandler.d.ts +0 -1
- package/dist/infrastructure/server/sseHandler.js +0 -1
- package/dist/infrastructure/server/tcp.d.ts +17 -1
- package/dist/infrastructure/server/tcp.js +112 -15
- package/dist/infrastructure/server/types.d.ts +0 -1
- package/dist/infrastructure/server/types.js +0 -1
- package/dist/infrastructure/server/wsHandler.d.ts +0 -1
- package/dist/infrastructure/server/wsHandler.js +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +48 -44
- package/dist/mcp/adapter.d.ts +3 -4
- package/dist/mcp/adapter.js +48 -16
- package/dist/mcp/httpHandler.d.ts +0 -1
- package/dist/mcp/httpHandler.js +0 -1
- package/dist/mcp/index.d.ts +3 -4
- package/dist/mcp/index.js +26 -90
- package/dist/mcp/prompts.d.ts +0 -1
- package/dist/mcp/prompts.js +0 -1
- package/dist/mcp/resources.d.ts +0 -1
- package/dist/mcp/resources.js +0 -1
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.js +100 -0
- package/dist/mcp/tools/consumptionTools.d.ts +0 -1
- package/dist/mcp/tools/consumptionTools.js +0 -1
- package/dist/mcp/tools/cronTools.d.ts +0 -1
- package/dist/mcp/tools/cronTools.js +0 -1
- package/dist/mcp/tools/dlqTools.d.ts +0 -1
- package/dist/mcp/tools/dlqTools.js +0 -1
- package/dist/mcp/tools/flowTools.d.ts +0 -1
- package/dist/mcp/tools/flowTools.js +0 -1
- package/dist/mcp/tools/handlerTools.d.ts +0 -1
- package/dist/mcp/tools/handlerTools.js +0 -1
- package/dist/mcp/tools/jobMgmtTools.d.ts +0 -1
- package/dist/mcp/tools/jobMgmtTools.js +0 -1
- package/dist/mcp/tools/jobTools.d.ts +0 -1
- package/dist/mcp/tools/jobTools.js +0 -1
- package/dist/mcp/tools/mcpTracker.d.ts +0 -1
- package/dist/mcp/tools/mcpTracker.js +0 -1
- package/dist/mcp/tools/monitoringTools.d.ts +0 -1
- package/dist/mcp/tools/monitoringTools.js +0 -1
- package/dist/mcp/tools/queueTools.d.ts +0 -1
- package/dist/mcp/tools/queueTools.js +6 -4
- package/dist/mcp/tools/rateLimitTools.d.ts +0 -1
- package/dist/mcp/tools/rateLimitTools.js +0 -1
- package/dist/mcp/tools/webhookTools.d.ts +0 -1
- package/dist/mcp/tools/webhookTools.js +1 -2
- package/dist/mcp/tools/withErrorHandler.d.ts +0 -1
- package/dist/mcp/tools/withErrorHandler.js +0 -1
- package/dist/mcp/tools/workerMgmtTools.d.ts +0 -1
- package/dist/mcp/tools/workerMgmtTools.js +0 -1
- package/dist/shared/boundedMap.d.ts +0 -1
- package/dist/shared/boundedMap.js +0 -1
- package/dist/shared/boundedSet.d.ts +0 -1
- package/dist/shared/boundedSet.js +0 -1
- package/dist/shared/hash.d.ts +0 -1
- package/dist/shared/hash.js +0 -1
- package/dist/shared/histogram.d.ts +0 -1
- package/dist/shared/histogram.js +0 -1
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +0 -1
- package/dist/shared/lock.d.ts +0 -1
- package/dist/shared/lock.js +15 -1
- package/dist/shared/logger.d.ts +0 -1
- package/dist/shared/logger.js +0 -1
- package/dist/shared/lru.d.ts +0 -1
- package/dist/shared/lru.js +0 -1
- package/dist/shared/lruMap.d.ts +0 -1
- package/dist/shared/lruMap.js +0 -1
- package/dist/shared/lruSet.d.ts +0 -1
- package/dist/shared/lruSet.js +0 -1
- package/dist/shared/minHeap.d.ts +0 -1
- package/dist/shared/minHeap.js +0 -1
- package/dist/shared/semaphore.d.ts +0 -1
- package/dist/shared/semaphore.js +0 -1
- package/dist/shared/serialization.d.ts +0 -1
- package/dist/shared/serialization.js +0 -1
- package/dist/shared/skipList.d.ts +0 -1
- package/dist/shared/skipList.js +0 -1
- package/dist/shared/ttlMap.d.ts +0 -1
- package/dist/shared/ttlMap.js +0 -1
- package/dist/shared/version.d.ts +0 -1
- package/dist/shared/version.js +0 -1
- package/dist/shared/webhookValidation.d.ts +0 -1
- package/dist/shared/webhookValidation.js +0 -1
- package/package.json +12 -9
- package/dist/application/backgroundTasks.d.ts.map +0 -1
- package/dist/application/backgroundTasks.js.map +0 -1
- package/dist/application/cleanupTasks.d.ts.map +0 -1
- package/dist/application/cleanupTasks.js.map +0 -1
- package/dist/application/clientTracking.d.ts.map +0 -1
- package/dist/application/clientTracking.js.map +0 -1
- package/dist/application/contextFactory.d.ts.map +0 -1
- package/dist/application/contextFactory.js.map +0 -1
- package/dist/application/dependencyProcessor.d.ts.map +0 -1
- package/dist/application/dependencyProcessor.js.map +0 -1
- package/dist/application/dlqManager.d.ts.map +0 -1
- package/dist/application/dlqManager.js.map +0 -1
- package/dist/application/eventsManager.d.ts.map +0 -1
- package/dist/application/eventsManager.js.map +0 -1
- package/dist/application/jobLogsManager.d.ts.map +0 -1
- package/dist/application/jobLogsManager.js.map +0 -1
- package/dist/application/latencyTracker.d.ts.map +0 -1
- package/dist/application/latencyTracker.js.map +0 -1
- package/dist/application/lockManager.d.ts.map +0 -1
- package/dist/application/lockManager.js.map +0 -1
- package/dist/application/lockOperations.d.ts.map +0 -1
- package/dist/application/lockOperations.js.map +0 -1
- package/dist/application/metricsExporter.d.ts.map +0 -1
- package/dist/application/metricsExporter.js.map +0 -1
- package/dist/application/monitoringChecks.d.ts.map +0 -1
- package/dist/application/monitoringChecks.js.map +0 -1
- package/dist/application/operations/ack.d.ts.map +0 -1
- package/dist/application/operations/ack.js.map +0 -1
- package/dist/application/operations/ackHelpers.d.ts.map +0 -1
- package/dist/application/operations/ackHelpers.js.map +0 -1
- package/dist/application/operations/index.d.ts.map +0 -1
- package/dist/application/operations/index.js.map +0 -1
- package/dist/application/operations/jobManagement.d.ts.map +0 -1
- package/dist/application/operations/jobManagement.js.map +0 -1
- package/dist/application/operations/jobStateTransitions.d.ts.map +0 -1
- package/dist/application/operations/jobStateTransitions.js.map +0 -1
- package/dist/application/operations/pull.d.ts.map +0 -1
- package/dist/application/operations/pull.js.map +0 -1
- package/dist/application/operations/push.d.ts.map +0 -1
- package/dist/application/operations/push.js.map +0 -1
- package/dist/application/operations/queryOperations.d.ts.map +0 -1
- package/dist/application/operations/queryOperations.js.map +0 -1
- package/dist/application/operations/queueControl.d.ts.map +0 -1
- package/dist/application/operations/queueControl.js.map +0 -1
- package/dist/application/queueManager.d.ts.map +0 -1
- package/dist/application/queueManager.js.map +0 -1
- package/dist/application/stallDetection.d.ts.map +0 -1
- package/dist/application/stallDetection.js.map +0 -1
- package/dist/application/statsManager.d.ts.map +0 -1
- package/dist/application/statsManager.js.map +0 -1
- package/dist/application/taskErrorTracking.d.ts.map +0 -1
- package/dist/application/taskErrorTracking.js.map +0 -1
- package/dist/application/throughputTracker.d.ts.map +0 -1
- package/dist/application/throughputTracker.js.map +0 -1
- package/dist/application/types.d.ts.map +0 -1
- package/dist/application/types.js.map +0 -1
- package/dist/application/webhookManager.d.ts.map +0 -1
- package/dist/application/webhookManager.js.map +0 -1
- package/dist/application/workerManager.d.ts.map +0 -1
- package/dist/application/workerManager.js.map +0 -1
- package/dist/cli/client.d.ts.map +0 -1
- package/dist/cli/client.js.map +0 -1
- package/dist/cli/commands/backup.d.ts.map +0 -1
- package/dist/cli/commands/backup.js.map +0 -1
- package/dist/cli/commands/core.d.ts.map +0 -1
- package/dist/cli/commands/core.js.map +0 -1
- package/dist/cli/commands/cron.d.ts.map +0 -1
- package/dist/cli/commands/cron.js.map +0 -1
- package/dist/cli/commands/dlq.d.ts.map +0 -1
- package/dist/cli/commands/dlq.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/job.d.ts.map +0 -1
- package/dist/cli/commands/job.js.map +0 -1
- package/dist/cli/commands/monitor.d.ts.map +0 -1
- package/dist/cli/commands/monitor.js.map +0 -1
- package/dist/cli/commands/queue.d.ts.map +0 -1
- package/dist/cli/commands/queue.js.map +0 -1
- package/dist/cli/commands/rateLimit.d.ts.map +0 -1
- package/dist/cli/commands/rateLimit.js.map +0 -1
- package/dist/cli/commands/server.d.ts.map +0 -1
- package/dist/cli/commands/server.js.map +0 -1
- package/dist/cli/commands/types.d.ts.map +0 -1
- package/dist/cli/commands/types.js.map +0 -1
- package/dist/cli/commands/webhook.d.ts.map +0 -1
- package/dist/cli/commands/webhook.js.map +0 -1
- package/dist/cli/commands/worker.d.ts.map +0 -1
- package/dist/cli/commands/worker.js.map +0 -1
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/output.d.ts.map +0 -1
- package/dist/cli/output.js.map +0 -1
- package/dist/client/bunqueue/aging.d.ts.map +0 -1
- package/dist/client/bunqueue/aging.js.map +0 -1
- package/dist/client/bunqueue/batch.d.ts.map +0 -1
- package/dist/client/bunqueue/batch.js.map +0 -1
- package/dist/client/bunqueue/cancellation.d.ts.map +0 -1
- package/dist/client/bunqueue/cancellation.js.map +0 -1
- package/dist/client/bunqueue/circuitBreaker.d.ts.map +0 -1
- package/dist/client/bunqueue/circuitBreaker.js.map +0 -1
- package/dist/client/bunqueue/dedupDebounce.d.ts.map +0 -1
- package/dist/client/bunqueue/dedupDebounce.js.map +0 -1
- package/dist/client/bunqueue/dlqRateLimit.d.ts.map +0 -1
- package/dist/client/bunqueue/dlqRateLimit.js.map +0 -1
- package/dist/client/bunqueue/retry.d.ts.map +0 -1
- package/dist/client/bunqueue/retry.js.map +0 -1
- package/dist/client/bunqueue/triggers.d.ts.map +0 -1
- package/dist/client/bunqueue/triggers.js.map +0 -1
- package/dist/client/bunqueue/ttl.d.ts.map +0 -1
- package/dist/client/bunqueue/ttl.js.map +0 -1
- package/dist/client/bunqueue/types.d.ts.map +0 -1
- package/dist/client/bunqueue/types.js.map +0 -1
- package/dist/client/bunqueue.d.ts.map +0 -1
- package/dist/client/bunqueue.js.map +0 -1
- package/dist/client/errors.d.ts.map +0 -1
- package/dist/client/errors.js.map +0 -1
- package/dist/client/events.d.ts.map +0 -1
- package/dist/client/events.js.map +0 -1
- package/dist/client/flow.d.ts.map +0 -1
- package/dist/client/flow.js.map +0 -1
- package/dist/client/flowJobFactory.d.ts.map +0 -1
- package/dist/client/flowJobFactory.js.map +0 -1
- package/dist/client/flowPush.d.ts.map +0 -1
- package/dist/client/flowPush.js.map +0 -1
- package/dist/client/flowTypes.d.ts.map +0 -1
- package/dist/client/flowTypes.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/jobConversion.d.ts.map +0 -1
- package/dist/client/jobConversion.js.map +0 -1
- package/dist/client/jobConversionHelpers.d.ts.map +0 -1
- package/dist/client/jobConversionHelpers.js.map +0 -1
- package/dist/client/jobConversionTypes.d.ts.map +0 -1
- package/dist/client/jobConversionTypes.js.map +0 -1
- package/dist/client/jobHelpers.d.ts.map +0 -1
- package/dist/client/jobHelpers.js.map +0 -1
- package/dist/client/manager.d.ts.map +0 -1
- package/dist/client/manager.js.map +0 -1
- package/dist/client/queue/addBatcher.d.ts.map +0 -1
- package/dist/client/queue/addBatcher.js.map +0 -1
- package/dist/client/queue/bullmqCompat.d.ts.map +0 -1
- package/dist/client/queue/bullmqCompat.js.map +0 -1
- package/dist/client/queue/deduplication.d.ts.map +0 -1
- package/dist/client/queue/deduplication.js.map +0 -1
- package/dist/client/queue/dlq.d.ts.map +0 -1
- package/dist/client/queue/dlq.js.map +0 -1
- package/dist/client/queue/dlqOps.d.ts.map +0 -1
- package/dist/client/queue/dlqOps.js.map +0 -1
- package/dist/client/queue/helpers.d.ts.map +0 -1
- package/dist/client/queue/helpers.js.map +0 -1
- package/dist/client/queue/index.d.ts.map +0 -1
- package/dist/client/queue/index.js.map +0 -1
- package/dist/client/queue/jobMove.d.ts.map +0 -1
- package/dist/client/queue/jobMove.js.map +0 -1
- package/dist/client/queue/jobProxy.d.ts.map +0 -1
- package/dist/client/queue/jobProxy.js.map +0 -1
- package/dist/client/queue/operations/add.d.ts.map +0 -1
- package/dist/client/queue/operations/add.js.map +0 -1
- package/dist/client/queue/operations/control.d.ts.map +0 -1
- package/dist/client/queue/operations/control.js.map +0 -1
- package/dist/client/queue/operations/counts.d.ts.map +0 -1
- package/dist/client/queue/operations/counts.js.map +0 -1
- package/dist/client/queue/operations/index.d.ts.map +0 -1
- package/dist/client/queue/operations/index.js.map +0 -1
- package/dist/client/queue/operations/management.d.ts.map +0 -1
- package/dist/client/queue/operations/management.js.map +0 -1
- package/dist/client/queue/operations/query.d.ts.map +0 -1
- package/dist/client/queue/operations/query.js.map +0 -1
- package/dist/client/queue/queue.d.ts.map +0 -1
- package/dist/client/queue/queue.js.map +0 -1
- package/dist/client/queue/queueTypes.d.ts.map +0 -1
- package/dist/client/queue/queueTypes.js.map +0 -1
- package/dist/client/queue/rateLimit.d.ts.map +0 -1
- package/dist/client/queue/rateLimit.js.map +0 -1
- package/dist/client/queue/scheduler.d.ts.map +0 -1
- package/dist/client/queue/scheduler.js.map +0 -1
- package/dist/client/queue/stall.d.ts.map +0 -1
- package/dist/client/queue/stall.js.map +0 -1
- package/dist/client/queue/workers.d.ts.map +0 -1
- package/dist/client/queue/workers.js.map +0 -1
- package/dist/client/queue.d.ts.map +0 -1
- package/dist/client/queue.js.map +0 -1
- package/dist/client/queueGroup.d.ts.map +0 -1
- package/dist/client/queueGroup.js.map +0 -1
- package/dist/client/resolveToken.d.ts.map +0 -1
- package/dist/client/resolveToken.js.map +0 -1
- package/dist/client/sandboxed/index.d.ts.map +0 -1
- package/dist/client/sandboxed/index.js.map +0 -1
- package/dist/client/sandboxed/queueOps.d.ts.map +0 -1
- package/dist/client/sandboxed/queueOps.js.map +0 -1
- package/dist/client/sandboxed/types.d.ts.map +0 -1
- package/dist/client/sandboxed/types.js.map +0 -1
- package/dist/client/sandboxed/worker.d.ts.map +0 -1
- package/dist/client/sandboxed/worker.js.map +0 -1
- package/dist/client/sandboxed/wrapper.d.ts.map +0 -1
- package/dist/client/sandboxed/wrapper.js.map +0 -1
- package/dist/client/sandboxedWorker.d.ts.map +0 -1
- package/dist/client/sandboxedWorker.js.map +0 -1
- package/dist/client/tcp/client.d.ts.map +0 -1
- package/dist/client/tcp/client.js.map +0 -1
- package/dist/client/tcp/connection.d.ts.map +0 -1
- package/dist/client/tcp/connection.js.map +0 -1
- package/dist/client/tcp/health.d.ts.map +0 -1
- package/dist/client/tcp/health.js.map +0 -1
- package/dist/client/tcp/index.d.ts.map +0 -1
- package/dist/client/tcp/index.js.map +0 -1
- package/dist/client/tcp/reconnect.d.ts.map +0 -1
- package/dist/client/tcp/reconnect.js.map +0 -1
- package/dist/client/tcp/shared.d.ts.map +0 -1
- package/dist/client/tcp/shared.js.map +0 -1
- package/dist/client/tcp/types.d.ts.map +0 -1
- package/dist/client/tcp/types.js.map +0 -1
- package/dist/client/tcpClient.d.ts.map +0 -1
- package/dist/client/tcpClient.js.map +0 -1
- package/dist/client/tcpPool.d.ts.map +0 -1
- package/dist/client/tcpPool.js.map +0 -1
- package/dist/client/types.d.ts.map +0 -1
- package/dist/client/types.js.map +0 -1
- package/dist/client/worker/ackBatcher.d.ts.map +0 -1
- package/dist/client/worker/ackBatcher.js.map +0 -1
- package/dist/client/worker/groupConcurrency.d.ts.map +0 -1
- package/dist/client/worker/groupConcurrency.js.map +0 -1
- package/dist/client/worker/index.d.ts.map +0 -1
- package/dist/client/worker/index.js.map +0 -1
- package/dist/client/worker/jobParser.d.ts.map +0 -1
- package/dist/client/worker/jobParser.js.map +0 -1
- package/dist/client/worker/processor.d.ts.map +0 -1
- package/dist/client/worker/processor.js.map +0 -1
- package/dist/client/worker/types.d.ts.map +0 -1
- package/dist/client/worker/types.js.map +0 -1
- package/dist/client/worker/worker.d.ts.map +0 -1
- package/dist/client/worker/worker.js.map +0 -1
- package/dist/client/worker/workerHeartbeat.d.ts.map +0 -1
- package/dist/client/worker/workerHeartbeat.js.map +0 -1
- package/dist/client/worker/workerPull.d.ts.map +0 -1
- package/dist/client/worker/workerPull.js.map +0 -1
- package/dist/client/worker/workerRateLimiter.d.ts.map +0 -1
- package/dist/client/worker/workerRateLimiter.js.map +0 -1
- package/dist/client/worker.d.ts.map +0 -1
- package/dist/client/worker.js.map +0 -1
- package/dist/client/workflow/emitter.d.ts.map +0 -1
- package/dist/client/workflow/emitter.js.map +0 -1
- package/dist/client/workflow/engine.d.ts.map +0 -1
- package/dist/client/workflow/engine.js.map +0 -1
- package/dist/client/workflow/executor.d.ts.map +0 -1
- package/dist/client/workflow/executor.js.map +0 -1
- package/dist/client/workflow/index.d.ts.map +0 -1
- package/dist/client/workflow/index.js.map +0 -1
- package/dist/client/workflow/loops.d.ts.map +0 -1
- package/dist/client/workflow/loops.js.map +0 -1
- package/dist/client/workflow/runner.d.ts.map +0 -1
- package/dist/client/workflow/runner.js.map +0 -1
- package/dist/client/workflow/store.d.ts.map +0 -1
- package/dist/client/workflow/store.js.map +0 -1
- package/dist/client/workflow/types.d.ts.map +0 -1
- package/dist/client/workflow/types.js.map +0 -1
- package/dist/client/workflow/workflow.d.ts.map +0 -1
- package/dist/client/workflow/workflow.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/loader.d.ts.map +0 -1
- package/dist/config/loader.js.map +0 -1
- package/dist/config/resolve.d.ts.map +0 -1
- package/dist/config/resolve.js.map +0 -1
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js.map +0 -1
- package/dist/domain/queue/dependencyTracker.d.ts.map +0 -1
- package/dist/domain/queue/dependencyTracker.js.map +0 -1
- package/dist/domain/queue/dlqShard.d.ts.map +0 -1
- package/dist/domain/queue/dlqShard.js.map +0 -1
- package/dist/domain/queue/index.d.ts.map +0 -1
- package/dist/domain/queue/index.js.map +0 -1
- package/dist/domain/queue/limiterManager.d.ts.map +0 -1
- package/dist/domain/queue/limiterManager.js.map +0 -1
- package/dist/domain/queue/priorityQueue.d.ts.map +0 -1
- package/dist/domain/queue/priorityQueue.js.map +0 -1
- package/dist/domain/queue/shard.d.ts.map +0 -1
- package/dist/domain/queue/shard.js.map +0 -1
- package/dist/domain/queue/shardCounters.d.ts.map +0 -1
- package/dist/domain/queue/shardCounters.js.map +0 -1
- package/dist/domain/queue/temporalManager.d.ts.map +0 -1
- package/dist/domain/queue/temporalManager.js.map +0 -1
- package/dist/domain/queue/uniqueKeyManager.d.ts.map +0 -1
- package/dist/domain/queue/uniqueKeyManager.js.map +0 -1
- package/dist/domain/queue/waiterManager.d.ts.map +0 -1
- package/dist/domain/queue/waiterManager.js.map +0 -1
- package/dist/domain/types/command.d.ts.map +0 -1
- package/dist/domain/types/command.js.map +0 -1
- package/dist/domain/types/cron.d.ts.map +0 -1
- package/dist/domain/types/cron.js.map +0 -1
- package/dist/domain/types/deduplication.d.ts.map +0 -1
- package/dist/domain/types/deduplication.js.map +0 -1
- package/dist/domain/types/dlq.d.ts.map +0 -1
- package/dist/domain/types/dlq.js.map +0 -1
- package/dist/domain/types/index.d.ts.map +0 -1
- package/dist/domain/types/index.js.map +0 -1
- package/dist/domain/types/job.d.ts.map +0 -1
- package/dist/domain/types/job.js.map +0 -1
- package/dist/domain/types/queue.d.ts.map +0 -1
- package/dist/domain/types/queue.js.map +0 -1
- package/dist/domain/types/response.d.ts.map +0 -1
- package/dist/domain/types/response.js.map +0 -1
- package/dist/domain/types/stall.d.ts.map +0 -1
- package/dist/domain/types/stall.js.map +0 -1
- package/dist/domain/types/webhook.d.ts.map +0 -1
- package/dist/domain/types/webhook.js.map +0 -1
- package/dist/domain/types/worker.d.ts.map +0 -1
- package/dist/domain/types/worker.js.map +0 -1
- package/dist/infrastructure/backup/index.d.ts.map +0 -1
- package/dist/infrastructure/backup/index.js.map +0 -1
- package/dist/infrastructure/backup/s3Backup.d.ts.map +0 -1
- package/dist/infrastructure/backup/s3Backup.js.map +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.d.ts.map +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.js.map +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.d.ts.map +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.js.map +0 -1
- package/dist/infrastructure/cloud/buffer.d.ts.map +0 -1
- package/dist/infrastructure/cloud/buffer.js.map +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.d.ts.map +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.js.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent 2.d.ts +0 -55
- package/dist/infrastructure/cloud/cloudAgent 2.d.ts.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent 2.js +0 -243
- package/dist/infrastructure/cloud/cloudAgent 2.js.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent.d.ts.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent.js.map +0 -1
- package/dist/infrastructure/cloud/commandHandler 2.d.ts +0 -52
- package/dist/infrastructure/cloud/commandHandler 2.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commandHandler 2.js +0 -84
- package/dist/infrastructure/cloud/commandHandler 2.js.map +0 -1
- package/dist/infrastructure/cloud/commandHandler.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commandHandler.js.map +0 -1
- package/dist/infrastructure/cloud/commands 2.d.ts +0 -11
- package/dist/infrastructure/cloud/commands 2.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commands 2.js +0 -343
- package/dist/infrastructure/cloud/commands 2.js.map +0 -1
- package/dist/infrastructure/cloud/commands.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commands.js.map +0 -1
- package/dist/infrastructure/cloud/config.d.ts.map +0 -1
- package/dist/infrastructure/cloud/config.js.map +0 -1
- package/dist/infrastructure/cloud/httpSender.d.ts.map +0 -1
- package/dist/infrastructure/cloud/httpSender.js.map +0 -1
- package/dist/infrastructure/cloud/index.d.ts.map +0 -1
- package/dist/infrastructure/cloud/index.js.map +0 -1
- package/dist/infrastructure/cloud/instanceId.d.ts +0 -7
- package/dist/infrastructure/cloud/instanceId.d.ts.map +0 -1
- package/dist/infrastructure/cloud/instanceId.js +0 -34
- package/dist/infrastructure/cloud/instanceId.js.map +0 -1
- package/dist/infrastructure/cloud/logger.d.ts.map +0 -1
- package/dist/infrastructure/cloud/logger.js.map +0 -1
- package/dist/infrastructure/cloud/snapshotCollector.d.ts.map +0 -1
- package/dist/infrastructure/cloud/snapshotCollector.js.map +0 -1
- package/dist/infrastructure/cloud/snapshotHelpers.d.ts.map +0 -1
- package/dist/infrastructure/cloud/snapshotHelpers.js.map +0 -1
- package/dist/infrastructure/cloud/statsRefresh.d.ts.map +0 -1
- package/dist/infrastructure/cloud/statsRefresh.js.map +0 -1
- package/dist/infrastructure/cloud/statsUpdate.d.ts.map +0 -1
- package/dist/infrastructure/cloud/statsUpdate.js.map +0 -1
- package/dist/infrastructure/cloud/types.d.ts.map +0 -1
- package/dist/infrastructure/cloud/types.js.map +0 -1
- package/dist/infrastructure/cloud/wsSender.d.ts.map +0 -1
- package/dist/infrastructure/cloud/wsSender.js.map +0 -1
- package/dist/infrastructure/persistence/index.d.ts.map +0 -1
- package/dist/infrastructure/persistence/index.js.map +0 -1
- package/dist/infrastructure/persistence/schema.d.ts.map +0 -1
- package/dist/infrastructure/persistence/schema.js.map +0 -1
- package/dist/infrastructure/persistence/sqlite.d.ts.map +0 -1
- package/dist/infrastructure/persistence/sqlite.js.map +0 -1
- package/dist/infrastructure/persistence/sqliteBatch.d.ts.map +0 -1
- package/dist/infrastructure/persistence/sqliteBatch.js.map +0 -1
- package/dist/infrastructure/persistence/sqliteSerializer.d.ts.map +0 -1
- package/dist/infrastructure/persistence/sqliteSerializer.js.map +0 -1
- package/dist/infrastructure/persistence/statements.d.ts.map +0 -1
- package/dist/infrastructure/persistence/statements.js.map +0 -1
- package/dist/infrastructure/scheduler/cronParser.d.ts.map +0 -1
- package/dist/infrastructure/scheduler/cronParser.js.map +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.d.ts.map +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.js.map +0 -1
- package/dist/infrastructure/scheduler/index.d.ts.map +0 -1
- package/dist/infrastructure/scheduler/index.js.map +0 -1
- package/dist/infrastructure/server/handler.d.ts.map +0 -1
- package/dist/infrastructure/server/handler.js.map +0 -1
- package/dist/infrastructure/server/handlerRoutes.d.ts.map +0 -1
- package/dist/infrastructure/server/handlerRoutes.js.map +0 -1
- package/dist/infrastructure/server/handlers/advanced.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/advanced.js.map +0 -1
- package/dist/infrastructure/server/handlers/core.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/core.js.map +0 -1
- package/dist/infrastructure/server/handlers/cron.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/cron.js.map +0 -1
- package/dist/infrastructure/server/handlers/dashboard.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/dashboard.js.map +0 -1
- package/dist/infrastructure/server/handlers/dlq.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/dlq.js.map +0 -1
- package/dist/infrastructure/server/handlers/index.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/index.js.map +0 -1
- package/dist/infrastructure/server/handlers/management.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/management.js.map +0 -1
- package/dist/infrastructure/server/handlers/monitoring.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/monitoring.js.map +0 -1
- package/dist/infrastructure/server/handlers/query.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/query.js.map +0 -1
- package/dist/infrastructure/server/http.d.ts.map +0 -1
- package/dist/infrastructure/server/http.js.map +0 -1
- package/dist/infrastructure/server/httpEndpoints.d.ts.map +0 -1
- package/dist/infrastructure/server/httpEndpoints.js.map +0 -1
- package/dist/infrastructure/server/httpRouteJobs.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteJobs.js.map +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.js.map +0 -1
- package/dist/infrastructure/server/httpRouteQueues.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteQueues.js.map +0 -1
- package/dist/infrastructure/server/httpRouteResources.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteResources.js.map +0 -1
- package/dist/infrastructure/server/index.d.ts.map +0 -1
- package/dist/infrastructure/server/index.js.map +0 -1
- package/dist/infrastructure/server/protocol.d.ts.map +0 -1
- package/dist/infrastructure/server/protocol.js.map +0 -1
- package/dist/infrastructure/server/rateLimiter.d.ts.map +0 -1
- package/dist/infrastructure/server/rateLimiter.js.map +0 -1
- package/dist/infrastructure/server/sseHandler.d.ts.map +0 -1
- package/dist/infrastructure/server/sseHandler.js.map +0 -1
- package/dist/infrastructure/server/tcp.d.ts.map +0 -1
- package/dist/infrastructure/server/tcp.js.map +0 -1
- package/dist/infrastructure/server/types.d.ts.map +0 -1
- package/dist/infrastructure/server/types.js.map +0 -1
- package/dist/infrastructure/server/wsHandler.d.ts.map +0 -1
- package/dist/infrastructure/server/wsHandler.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/mcp/adapter.d.ts.map +0 -1
- package/dist/mcp/adapter.js.map +0 -1
- package/dist/mcp/httpHandler.d.ts.map +0 -1
- package/dist/mcp/httpHandler.js.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/mcpHandlers.d.ts +0 -129
- package/dist/mcp/mcpHandlers.d.ts.map +0 -1
- package/dist/mcp/mcpHandlers.js +0 -204
- package/dist/mcp/mcpHandlers.js.map +0 -1
- package/dist/mcp/mcpTools.d.ts +0 -15
- package/dist/mcp/mcpTools.d.ts.map +0 -1
- package/dist/mcp/mcpTools.js +0 -277
- package/dist/mcp/mcpTools.js.map +0 -1
- package/dist/mcp/prompts.d.ts.map +0 -1
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/resources.d.ts.map +0 -1
- package/dist/mcp/resources.js.map +0 -1
- package/dist/mcp/tools/consumptionTools.d.ts.map +0 -1
- package/dist/mcp/tools/consumptionTools.js.map +0 -1
- package/dist/mcp/tools/cronTools.d.ts.map +0 -1
- package/dist/mcp/tools/cronTools.js.map +0 -1
- package/dist/mcp/tools/dlqTools.d.ts.map +0 -1
- package/dist/mcp/tools/dlqTools.js.map +0 -1
- package/dist/mcp/tools/flowTools.d.ts.map +0 -1
- package/dist/mcp/tools/flowTools.js.map +0 -1
- package/dist/mcp/tools/handlerTools.d.ts.map +0 -1
- package/dist/mcp/tools/handlerTools.js.map +0 -1
- package/dist/mcp/tools/jobMgmtTools.d.ts.map +0 -1
- package/dist/mcp/tools/jobMgmtTools.js.map +0 -1
- package/dist/mcp/tools/jobTools.d.ts.map +0 -1
- package/dist/mcp/tools/jobTools.js.map +0 -1
- package/dist/mcp/tools/mcpTracker.d.ts.map +0 -1
- package/dist/mcp/tools/mcpTracker.js.map +0 -1
- package/dist/mcp/tools/monitoringTools.d.ts.map +0 -1
- package/dist/mcp/tools/monitoringTools.js.map +0 -1
- package/dist/mcp/tools/queueTools.d.ts.map +0 -1
- package/dist/mcp/tools/queueTools.js.map +0 -1
- package/dist/mcp/tools/rateLimitTools.d.ts.map +0 -1
- package/dist/mcp/tools/rateLimitTools.js.map +0 -1
- package/dist/mcp/tools/webhookTools.d.ts.map +0 -1
- package/dist/mcp/tools/webhookTools.js.map +0 -1
- package/dist/mcp/tools/withErrorHandler.d.ts.map +0 -1
- package/dist/mcp/tools/withErrorHandler.js.map +0 -1
- package/dist/mcp/tools/workerMgmtTools.d.ts.map +0 -1
- package/dist/mcp/tools/workerMgmtTools.js.map +0 -1
- package/dist/shared/boundedMap.d.ts.map +0 -1
- package/dist/shared/boundedMap.js.map +0 -1
- package/dist/shared/boundedSet.d.ts.map +0 -1
- package/dist/shared/boundedSet.js.map +0 -1
- package/dist/shared/hash.d.ts.map +0 -1
- package/dist/shared/hash.js.map +0 -1
- package/dist/shared/histogram.d.ts.map +0 -1
- package/dist/shared/histogram.js.map +0 -1
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/lock.d.ts.map +0 -1
- package/dist/shared/lock.js.map +0 -1
- package/dist/shared/logger.d.ts.map +0 -1
- package/dist/shared/logger.js.map +0 -1
- package/dist/shared/lru.d.ts.map +0 -1
- package/dist/shared/lru.js.map +0 -1
- package/dist/shared/lruMap.d.ts.map +0 -1
- package/dist/shared/lruMap.js.map +0 -1
- package/dist/shared/lruSet.d.ts.map +0 -1
- package/dist/shared/lruSet.js.map +0 -1
- package/dist/shared/minHeap.d.ts.map +0 -1
- package/dist/shared/minHeap.js.map +0 -1
- package/dist/shared/semaphore.d.ts.map +0 -1
- package/dist/shared/semaphore.js.map +0 -1
- package/dist/shared/serialization.d.ts.map +0 -1
- package/dist/shared/serialization.js.map +0 -1
- package/dist/shared/skipList.d.ts.map +0 -1
- package/dist/shared/skipList.js.map +0 -1
- package/dist/shared/ttlMap.d.ts.map +0 -1
- package/dist/shared/ttlMap.js.map +0 -1
- package/dist/shared/version.d.ts.map +0 -1
- package/dist/shared/version.js.map +0 -1
- package/dist/shared/webhookValidation.d.ts.map +0 -1
- package/dist/shared/webhookValidation.js.map +0 -1
|
@@ -5,7 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Job, JobId, JobTimelineEntry } from '../../domain/types/job';
|
|
7
7
|
import type { CronJob } from '../../domain/types/cron';
|
|
8
|
-
import type
|
|
8
|
+
import { type DlqEntry } from '../../domain/types/dlq';
|
|
9
|
+
/** Critical-loss callback: invoked when WriteBuffer drops jobs after exhausting retries. */
|
|
10
|
+
export type SqliteCriticalLossCallback = (jobs: Job[], lastError: Error, attempts: number) => void;
|
|
11
|
+
/** Record of a critical job loss event (jobs dropped after max retries). */
|
|
12
|
+
export interface SqliteCriticalLoss {
|
|
13
|
+
jobs: Job[];
|
|
14
|
+
error: string;
|
|
15
|
+
attempts: number;
|
|
16
|
+
at: number;
|
|
17
|
+
}
|
|
9
18
|
/** SQLite configuration */
|
|
10
19
|
export interface SqliteConfig {
|
|
11
20
|
path: string;
|
|
@@ -16,6 +25,8 @@ export interface SqliteConfig {
|
|
|
16
25
|
writeBufferSize?: number;
|
|
17
26
|
/** Write buffer flush interval in ms (default: 50) */
|
|
18
27
|
writeBufferFlushMs?: number;
|
|
28
|
+
/** Callback invoked when WriteBuffer drops jobs after exhausting retries. */
|
|
29
|
+
onCriticalLoss?: SqliteCriticalLossCallback;
|
|
19
30
|
}
|
|
20
31
|
/**
|
|
21
32
|
* SQLite Storage class with write buffering for high throughput
|
|
@@ -28,7 +39,26 @@ export declare class SqliteStorage {
|
|
|
28
39
|
private _diskFull;
|
|
29
40
|
private _lastDiskFullError;
|
|
30
41
|
private _lastDiskFullAt;
|
|
42
|
+
private readonly _criticalLosses;
|
|
43
|
+
private readonly _onCriticalLoss?;
|
|
44
|
+
/** Cap on retained critical-loss records to prevent unbounded growth */
|
|
45
|
+
private static readonly MAX_RETAINED_LOSSES;
|
|
31
46
|
constructor(config: SqliteConfig);
|
|
47
|
+
/**
|
|
48
|
+
* Default handler for WriteBuffer critical loss. Logs every dropped job so
|
|
49
|
+
* ops can recover from logs, retains the last MAX_RETAINED_LOSSES records
|
|
50
|
+
* for programmatic inspection, and forwards to a user-provided callback.
|
|
51
|
+
*
|
|
52
|
+
* Without this handler the dropped jobs would be silently discarded by
|
|
53
|
+
* sqliteBatch.ts:209-223 (no callback = no recovery path).
|
|
54
|
+
*/
|
|
55
|
+
private handleCriticalLoss;
|
|
56
|
+
/** Truncate job data preview to keep logs readable. */
|
|
57
|
+
private previewJobData;
|
|
58
|
+
/** Retrieve retained critical-loss records (most recent last). */
|
|
59
|
+
getCriticalLosses(): readonly SqliteCriticalLoss[];
|
|
60
|
+
/** Clear retained critical-loss records (e.g. after operator acknowledgement). */
|
|
61
|
+
clearCriticalLosses(): void;
|
|
32
62
|
/** Mark disk as full and log */
|
|
33
63
|
private setDiskFull;
|
|
34
64
|
/** Execute a write operation with SQLITE_FULL detection */
|
|
@@ -52,6 +82,14 @@ export declare class SqliteStorage {
|
|
|
52
82
|
insertJob(job: Job, durable?: boolean): void;
|
|
53
83
|
/** Insert job immediately (bypass buffer) */
|
|
54
84
|
insertJobImmediate(job: Job): void;
|
|
85
|
+
/**
|
|
86
|
+
* Ensure a job's buffered INSERT has been written to disk before issuing a
|
|
87
|
+
* state-mutating UPDATE. Without this, markActive/markCompleted's UPDATE
|
|
88
|
+
* would silently match 0 rows and the state change would be overwritten
|
|
89
|
+
* when the buffered INSERT eventually fires with the original
|
|
90
|
+
* 'waiting'/'delayed' state baked at insert time.
|
|
91
|
+
*/
|
|
92
|
+
private flushIfBuffered;
|
|
55
93
|
markActive(jobId: JobId, startedAt: number, timeline?: JobTimelineEntry[]): void;
|
|
56
94
|
markCompleted(jobId: JobId, completedAt: number, timeline?: JobTimelineEntry[]): void;
|
|
57
95
|
markFailed(job: Job, error: string | null): void;
|
|
@@ -74,6 +112,14 @@ export declare class SqliteStorage {
|
|
|
74
112
|
getResult(jobId: JobId): unknown;
|
|
75
113
|
/** Check if a job result exists (for dependency checking during recovery) */
|
|
76
114
|
hasResult(jobId: JobId): boolean;
|
|
115
|
+
/** Check if a job has a DLQ entry (used for state/job fallback after restart) */
|
|
116
|
+
hasDlqEntry(jobId: JobId): boolean;
|
|
117
|
+
/** Get latest DLQ entry for a job (used for getJob fallback after restart) */
|
|
118
|
+
getDlqEntry(jobId: JobId): DlqEntry | null;
|
|
119
|
+
/** Load all DLQ job IDs (used by recovery to skip stale active rows) */
|
|
120
|
+
loadDlqJobIds(): Set<JobId>;
|
|
121
|
+
/** Get the persisted `state` column for a job. Returns null if the row is missing. */
|
|
122
|
+
getJobStateRaw(jobId: JobId): string | null;
|
|
77
123
|
/** Load all completed job IDs (for dependency recovery) */
|
|
78
124
|
loadCompletedJobIds(): Set<JobId>;
|
|
79
125
|
/** Insert batch of jobs (adds to buffer) */
|
|
@@ -102,6 +148,13 @@ export declare class SqliteStorage {
|
|
|
102
148
|
* @param offset Skip first N jobs (default: 0)
|
|
103
149
|
*/
|
|
104
150
|
loadActiveJobs(limit?: number, offset?: number): Job[];
|
|
151
|
+
/**
|
|
152
|
+
* Load completed jobs with pagination.
|
|
153
|
+
* Uses job_results join to get only jobs that were successfully completed.
|
|
154
|
+
* @param limit Max jobs to return (default: 10000)
|
|
155
|
+
* @param offset Skip first N jobs (default: 0)
|
|
156
|
+
*/
|
|
157
|
+
loadCompletedJobs(limit?: number, offset?: number): Job[];
|
|
105
158
|
/**
|
|
106
159
|
* Count pending jobs (for pagination)
|
|
107
160
|
*/
|
|
@@ -118,4 +171,3 @@ export declare class SqliteStorage {
|
|
|
118
171
|
close(): void;
|
|
119
172
|
getSize(): number;
|
|
120
173
|
}
|
|
121
|
-
//# sourceMappingURL=sqlite.d.ts.map
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Uses MessagePack for ~2-3x faster serialization than JSON
|
|
5
5
|
*/
|
|
6
6
|
import { Database } from 'bun:sqlite';
|
|
7
|
+
import { createDlqEntry } from '../../domain/types/dlq';
|
|
7
8
|
import { PRAGMA_SETTINGS, SCHEMA, MIGRATION_TABLE, SCHEMA_VERSION, MIGRATIONS } from './schema';
|
|
8
9
|
import { prepareStatements } from './statements';
|
|
9
10
|
import { pack, unpack, rowToJob, reconstructDlqEntry } from './sqliteSerializer';
|
|
@@ -27,11 +28,16 @@ export class SqliteStorage {
|
|
|
27
28
|
_diskFull = false;
|
|
28
29
|
_lastDiskFullError = null;
|
|
29
30
|
_lastDiskFullAt = null;
|
|
31
|
+
_criticalLosses = [];
|
|
32
|
+
_onCriticalLoss;
|
|
33
|
+
/** Cap on retained critical-loss records to prevent unbounded growth */
|
|
34
|
+
static MAX_RETAINED_LOSSES = 100;
|
|
30
35
|
constructor(config) {
|
|
31
36
|
this.db = new Database(config.path, { create: true });
|
|
32
37
|
this.db.run(PRAGMA_SETTINGS);
|
|
33
38
|
this.migrate();
|
|
34
39
|
this.statements = prepareStatements(this.db);
|
|
40
|
+
this._onCriticalLoss = config.onCriticalLoss;
|
|
35
41
|
// Initialize batch manager and write buffer
|
|
36
42
|
this.batchManager = new BatchInsertManager(this.db);
|
|
37
43
|
this.writeBuffer = new WriteBuffer(this.batchManager, config.writeBufferSize ?? 100, config.writeBufferFlushMs ?? 10, (err, jobCount) => {
|
|
@@ -43,8 +49,94 @@ export class SqliteStorage {
|
|
|
43
49
|
error: err.message,
|
|
44
50
|
diskFull: this._diskFull,
|
|
45
51
|
});
|
|
52
|
+
}, (jobs, lastError, attempts) => {
|
|
53
|
+
this.handleCriticalLoss(jobs, lastError, attempts);
|
|
46
54
|
});
|
|
47
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Default handler for WriteBuffer critical loss. Logs every dropped job so
|
|
58
|
+
* ops can recover from logs, retains the last MAX_RETAINED_LOSSES records
|
|
59
|
+
* for programmatic inspection, and forwards to a user-provided callback.
|
|
60
|
+
*
|
|
61
|
+
* Without this handler the dropped jobs would be silently discarded by
|
|
62
|
+
* sqliteBatch.ts:209-223 (no callback = no recovery path).
|
|
63
|
+
*/
|
|
64
|
+
handleCriticalLoss(jobs, lastError, attempts) {
|
|
65
|
+
storageLog.error('CRITICAL: WriteBuffer dropped jobs after exhausting retries', {
|
|
66
|
+
lostJobCount: jobs.length,
|
|
67
|
+
attempts,
|
|
68
|
+
error: lastError.message,
|
|
69
|
+
diskFull: this._diskFull,
|
|
70
|
+
});
|
|
71
|
+
for (const job of jobs) {
|
|
72
|
+
storageLog.error('Lost job (recover from this log if needed)', {
|
|
73
|
+
id: String(job.id),
|
|
74
|
+
queue: job.queue,
|
|
75
|
+
customId: job.customId,
|
|
76
|
+
priority: job.priority,
|
|
77
|
+
createdAt: job.createdAt,
|
|
78
|
+
attempts: job.attempts,
|
|
79
|
+
// Data preview (truncated to avoid log spam from huge payloads)
|
|
80
|
+
dataPreview: this.previewJobData(job.data),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
this._criticalLosses.push({
|
|
84
|
+
jobs,
|
|
85
|
+
error: lastError.message,
|
|
86
|
+
attempts,
|
|
87
|
+
at: Date.now(),
|
|
88
|
+
});
|
|
89
|
+
// Bound retention
|
|
90
|
+
while (this._criticalLosses.length > SqliteStorage.MAX_RETAINED_LOSSES) {
|
|
91
|
+
this._criticalLosses.shift();
|
|
92
|
+
}
|
|
93
|
+
// Durably persist each lost job to the DLQ table so it survives a restart
|
|
94
|
+
// and is recoverable via the normal DLQ path (getDlqEntry / loadDlq).
|
|
95
|
+
// saveDlqEntry() writes directly via the prepared `insertDlq` statement
|
|
96
|
+
// (NOT through the WriteBuffer that just exhausted its retries), so this
|
|
97
|
+
// cannot recurse back into the failing flush path.
|
|
98
|
+
for (const job of jobs) {
|
|
99
|
+
try {
|
|
100
|
+
this.saveDlqEntry(createDlqEntry(job, "unknown" /* FailureReason.Unknown */, lastError.message));
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
storageLog.error('Failed to persist lost job to DLQ', {
|
|
104
|
+
id: String(job.id),
|
|
105
|
+
queue: job.queue,
|
|
106
|
+
error: err instanceof Error ? err.message : String(err),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Forward to user-supplied callback if provided
|
|
111
|
+
if (this._onCriticalLoss) {
|
|
112
|
+
try {
|
|
113
|
+
this._onCriticalLoss(jobs, lastError, attempts);
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
storageLog.error('onCriticalLoss callback threw', {
|
|
117
|
+
error: err instanceof Error ? err.message : String(err),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Truncate job data preview to keep logs readable. */
|
|
123
|
+
previewJobData(data) {
|
|
124
|
+
try {
|
|
125
|
+
const s = JSON.stringify(data);
|
|
126
|
+
return s.length > 500 ? s.slice(0, 500) + '...[truncated]' : s;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return '[unserializable]';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** Retrieve retained critical-loss records (most recent last). */
|
|
133
|
+
getCriticalLosses() {
|
|
134
|
+
return this._criticalLosses;
|
|
135
|
+
}
|
|
136
|
+
/** Clear retained critical-loss records (e.g. after operator acknowledgement). */
|
|
137
|
+
clearCriticalLosses() {
|
|
138
|
+
this._criticalLosses.length = 0;
|
|
139
|
+
}
|
|
48
140
|
/** Mark disk as full and log */
|
|
49
141
|
setDiskFull(message) {
|
|
50
142
|
if (!this._diskFull) {
|
|
@@ -132,7 +224,28 @@ export class SqliteStorage {
|
|
|
132
224
|
.run(job.id, job.queue, pack(job.data), job.priority, job.createdAt, job.runAt, job.attempts, job.maxAttempts, job.backoff, job.ttl, job.timeout, job.uniqueKey, job.customId, job.dependsOn.length > 0 ? pack(job.dependsOn) : null, job.parentId, job.childrenIds.length > 0 ? pack(job.childrenIds) : null, job.tags.length > 0 ? pack(job.tags) : null, job.runAt > Date.now() ? 'delayed' : 'waiting', job.lifo ? 1 : 0, job.groupId, job.removeOnComplete ? 1 : 0, job.removeOnFail ? 1 : 0, job.stallTimeout, job.timeline.length > 0 ? pack(job.timeline) : null);
|
|
133
225
|
});
|
|
134
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Ensure a job's buffered INSERT has been written to disk before issuing a
|
|
229
|
+
* state-mutating UPDATE. Without this, markActive/markCompleted's UPDATE
|
|
230
|
+
* would silently match 0 rows and the state change would be overwritten
|
|
231
|
+
* when the buffered INSERT eventually fires with the original
|
|
232
|
+
* 'waiting'/'delayed' state baked at insert time.
|
|
233
|
+
*/
|
|
234
|
+
flushIfBuffered(jobId) {
|
|
235
|
+
if (this.writeBuffer.hasPending(String(jobId))) {
|
|
236
|
+
try {
|
|
237
|
+
this.writeBuffer.flush();
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
// Flush errors are already routed through onError/onCriticalLoss.
|
|
241
|
+
// Proceed to UPDATE — if the row really isn't there the UPDATE will
|
|
242
|
+
// no-op and the caller's in-memory state stays authoritative until
|
|
243
|
+
// the next successful flush or recovery cycle.
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
135
247
|
markActive(jobId, startedAt, timeline) {
|
|
248
|
+
this.flushIfBuffered(jobId);
|
|
136
249
|
this.safeWrite(() => {
|
|
137
250
|
this.statements
|
|
138
251
|
.get('updateJobState')
|
|
@@ -140,6 +253,7 @@ export class SqliteStorage {
|
|
|
140
253
|
});
|
|
141
254
|
}
|
|
142
255
|
markCompleted(jobId, completedAt, timeline) {
|
|
256
|
+
this.flushIfBuffered(jobId);
|
|
143
257
|
this.safeWrite(() => {
|
|
144
258
|
this.statements
|
|
145
259
|
.get('completeJob')
|
|
@@ -147,6 +261,7 @@ export class SqliteStorage {
|
|
|
147
261
|
});
|
|
148
262
|
}
|
|
149
263
|
markFailed(job, error) {
|
|
264
|
+
this.flushIfBuffered(job.id);
|
|
150
265
|
this.safeWrite(() => {
|
|
151
266
|
this.statements.get('insertDlq').run(job.id, job.queue, pack({ job, error }), Date.now());
|
|
152
267
|
});
|
|
@@ -197,8 +312,21 @@ export class SqliteStorage {
|
|
|
197
312
|
});
|
|
198
313
|
}
|
|
199
314
|
deleteJob(jobId) {
|
|
315
|
+
this.writeBuffer.removePending(jobId);
|
|
200
316
|
this.safeWrite(() => {
|
|
201
|
-
|
|
317
|
+
// Atomic cascade: job row + result must succeed or fail together so
|
|
318
|
+
// cleanAsync cannot leave orphan job_results rows (issue #84).
|
|
319
|
+
// DLQ is NOT cascaded here: moveFailedJobToDlq() intentionally calls
|
|
320
|
+
// saveDlqEntry() then deleteJob() to drop the jobs row while keeping
|
|
321
|
+
// the DLQ entry. Callers that want DLQ cleanup (e.g. cleanFailed)
|
|
322
|
+
// explicitly call deleteDlqEntry() before deleteJob().
|
|
323
|
+
const deleteStmt = this.statements.get('deleteJob');
|
|
324
|
+
const deleteResultStmt = this.statements.get('deleteJobResult');
|
|
325
|
+
const tx = this.db.transaction((id) => {
|
|
326
|
+
deleteStmt.run(id);
|
|
327
|
+
deleteResultStmt.run(id);
|
|
328
|
+
});
|
|
329
|
+
tx(jobId);
|
|
202
330
|
});
|
|
203
331
|
}
|
|
204
332
|
/** Update a job's data blob (e.g. after adding __parentId) */
|
|
@@ -235,6 +363,35 @@ export class SqliteStorage {
|
|
|
235
363
|
.get(String(jobId));
|
|
236
364
|
return row !== null;
|
|
237
365
|
}
|
|
366
|
+
/** Check if a job has a DLQ entry (used for state/job fallback after restart) */
|
|
367
|
+
hasDlqEntry(jobId) {
|
|
368
|
+
const row = this.db
|
|
369
|
+
.query('SELECT job_id FROM dlq WHERE job_id = ? LIMIT 1')
|
|
370
|
+
.get(String(jobId));
|
|
371
|
+
return row !== null;
|
|
372
|
+
}
|
|
373
|
+
/** Get latest DLQ entry for a job (used for getJob fallback after restart) */
|
|
374
|
+
getDlqEntry(jobId) {
|
|
375
|
+
const row = this.db
|
|
376
|
+
.query('SELECT entry FROM dlq WHERE job_id = ? ORDER BY entered_at DESC LIMIT 1')
|
|
377
|
+
.get(String(jobId));
|
|
378
|
+
if (!row)
|
|
379
|
+
return null;
|
|
380
|
+
const entry = unpack(row.entry, null, `getDlqEntry:${String(jobId)}`);
|
|
381
|
+
return entry?.job ? reconstructDlqEntry(entry) : null;
|
|
382
|
+
}
|
|
383
|
+
/** Load all DLQ job IDs (used by recovery to skip stale active rows) */
|
|
384
|
+
loadDlqJobIds() {
|
|
385
|
+
const rows = this.db.query('SELECT job_id FROM dlq').all();
|
|
386
|
+
return new Set(rows.map((r) => r.job_id));
|
|
387
|
+
}
|
|
388
|
+
/** Get the persisted `state` column for a job. Returns null if the row is missing. */
|
|
389
|
+
getJobStateRaw(jobId) {
|
|
390
|
+
const row = this.db
|
|
391
|
+
.query('SELECT state FROM jobs WHERE id = ?')
|
|
392
|
+
.get(String(jobId));
|
|
393
|
+
return row?.state ?? null;
|
|
394
|
+
}
|
|
238
395
|
/** Load all completed job IDs (for dependency recovery) */
|
|
239
396
|
loadCompletedJobIds() {
|
|
240
397
|
const rows = this.db.query('SELECT job_id FROM job_results').all();
|
|
@@ -294,6 +451,18 @@ export class SqliteStorage {
|
|
|
294
451
|
.all(limit, offset);
|
|
295
452
|
return rows.map((row) => rowToJob(row));
|
|
296
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Load completed jobs with pagination.
|
|
456
|
+
* Uses job_results join to get only jobs that were successfully completed.
|
|
457
|
+
* @param limit Max jobs to return (default: 10000)
|
|
458
|
+
* @param offset Skip first N jobs (default: 0)
|
|
459
|
+
*/
|
|
460
|
+
loadCompletedJobs(limit = 10000, offset = 0) {
|
|
461
|
+
const rows = this.db
|
|
462
|
+
.query("SELECT * FROM jobs WHERE state = 'completed' ORDER BY completed_at DESC LIMIT ? OFFSET ?")
|
|
463
|
+
.all(limit, offset);
|
|
464
|
+
return rows.map((row) => rowToJob(row));
|
|
465
|
+
}
|
|
297
466
|
/**
|
|
298
467
|
* Count pending jobs (for pagination)
|
|
299
468
|
*/
|
|
@@ -317,7 +486,7 @@ export class SqliteStorage {
|
|
|
317
486
|
this.safeWrite(() => {
|
|
318
487
|
this.statements
|
|
319
488
|
.get('insertCron')
|
|
320
|
-
.run(cron.name, cron.queue, pack(cron.data), cron.schedule, cron.repeatEvery, cron.priority, cron.nextRun, cron.executions, cron.maxLimit, cron.timezone, cron.uniqueKey, cron.dedup ? pack(cron.dedup) : null, cron.skipMissedOnRestart ? 1 : 0, cron.skipIfNoWorker ? 1 : 0, cron.preventOverlap ? 1 : 0);
|
|
489
|
+
.run(cron.name, cron.queue, pack(cron.data), cron.schedule, cron.repeatEvery, cron.priority, cron.nextRun, cron.executions, cron.maxLimit, cron.timezone, cron.uniqueKey, cron.dedup ? pack(cron.dedup) : null, cron.skipMissedOnRestart ? 1 : 0, cron.skipIfNoWorker ? 1 : 0, cron.preventOverlap ? 1 : 0, cron.jobOptions ? pack(cron.jobOptions) : null);
|
|
321
490
|
});
|
|
322
491
|
}
|
|
323
492
|
loadCronJobs() {
|
|
@@ -340,6 +509,9 @@ export class SqliteStorage {
|
|
|
340
509
|
skipMissedOnRestart: row.skip_missed_on_restart === 1,
|
|
341
510
|
skipIfNoWorker: row.skip_if_no_worker === 1,
|
|
342
511
|
preventOverlap: row.prevent_overlap === 1,
|
|
512
|
+
jobOptions: row.job_options
|
|
513
|
+
? unpack(row.job_options, null, `loadCronJobOptions:${row.name}`)
|
|
514
|
+
: null,
|
|
343
515
|
}));
|
|
344
516
|
}
|
|
345
517
|
deleteCron(name) {
|
|
@@ -381,4 +553,3 @@ export class SqliteStorage {
|
|
|
381
553
|
return file.size;
|
|
382
554
|
}
|
|
383
555
|
}
|
|
384
|
-
//# sourceMappingURL=sqlite.js.map
|
|
@@ -58,6 +58,20 @@ export declare class WriteBuffer {
|
|
|
58
58
|
private scheduleBackoffRetry;
|
|
59
59
|
/** Get pending job count (includes both buffers) */
|
|
60
60
|
get pendingCount(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Remove any pending buffered inserts for a given jobId.
|
|
63
|
+
* Prevents a buffered insert from flushing to disk after an immediate deleteJob,
|
|
64
|
+
* which would leave an orphan row with stale state.
|
|
65
|
+
*/
|
|
66
|
+
removePending(jobId: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Check whether a job is still sitting in the WriteBuffer (not yet persisted).
|
|
69
|
+
* Used by state-transition writes (markActive/Completed/Failed) to decide
|
|
70
|
+
* whether they need to flush the buffer first — otherwise their UPDATE
|
|
71
|
+
* would silently match 0 rows and the state change would be lost when the
|
|
72
|
+
* buffered INSERT eventually writes with the original state.
|
|
73
|
+
*/
|
|
74
|
+
hasPending(jobId: string): boolean;
|
|
61
75
|
/** Stop auto-flush timer and flush pending jobs */
|
|
62
76
|
stop(): void;
|
|
63
77
|
/**
|
|
@@ -76,4 +90,3 @@ export declare class WriteBuffer {
|
|
|
76
90
|
lastError: Error | null;
|
|
77
91
|
};
|
|
78
92
|
}
|
|
79
|
-
//# sourceMappingURL=sqliteBatch.d.ts.map
|
|
@@ -199,6 +199,35 @@ export class WriteBuffer {
|
|
|
199
199
|
get pendingCount() {
|
|
200
200
|
return this.activeBuffer.length + this.flushBuffer.length;
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Remove any pending buffered inserts for a given jobId.
|
|
204
|
+
* Prevents a buffered insert from flushing to disk after an immediate deleteJob,
|
|
205
|
+
* which would leave an orphan row with stale state.
|
|
206
|
+
*/
|
|
207
|
+
removePending(jobId) {
|
|
208
|
+
const i = this.activeBuffer.findIndex((j) => j.id === jobId);
|
|
209
|
+
if (i !== -1)
|
|
210
|
+
this.activeBuffer.splice(i, 1);
|
|
211
|
+
const j = this.flushBuffer.findIndex((j) => j.id === jobId);
|
|
212
|
+
if (j !== -1)
|
|
213
|
+
this.flushBuffer.splice(j, 1);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Check whether a job is still sitting in the WriteBuffer (not yet persisted).
|
|
217
|
+
* Used by state-transition writes (markActive/Completed/Failed) to decide
|
|
218
|
+
* whether they need to flush the buffer first — otherwise their UPDATE
|
|
219
|
+
* would silently match 0 rows and the state change would be lost when the
|
|
220
|
+
* buffered INSERT eventually writes with the original state.
|
|
221
|
+
*/
|
|
222
|
+
hasPending(jobId) {
|
|
223
|
+
for (const j of this.activeBuffer)
|
|
224
|
+
if (j.id === jobId)
|
|
225
|
+
return true;
|
|
226
|
+
for (const j of this.flushBuffer)
|
|
227
|
+
if (j.id === jobId)
|
|
228
|
+
return true;
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
202
231
|
/** Stop auto-flush timer and flush pending jobs */
|
|
203
232
|
stop() {
|
|
204
233
|
// Clear auto-flush timer
|
|
@@ -291,4 +320,3 @@ export class WriteBuffer {
|
|
|
291
320
|
};
|
|
292
321
|
}
|
|
293
322
|
}
|
|
294
|
-
//# sourceMappingURL=sqliteBatch.js.map
|
|
@@ -10,8 +10,23 @@ import type { DbJob } from './statements';
|
|
|
10
10
|
export declare function pack(data: unknown): Uint8Array;
|
|
11
11
|
/** Decode MessagePack buffer to data */
|
|
12
12
|
export declare function unpack<T>(buffer: Uint8Array | null, fallback: T, context: string): T;
|
|
13
|
+
/**
|
|
14
|
+
* Symbol marker stamped on a Job whose `depends_on` blob failed to decode.
|
|
15
|
+
*
|
|
16
|
+
* A corrupt dependency list must NOT collapse into `dependsOn: []` (which the
|
|
17
|
+
* recovery path treats as "ready, no deps" -> out-of-order execution). Rather
|
|
18
|
+
* than parking the job behind a magic-string dependency (which could collide
|
|
19
|
+
* with a real user-supplied jobId, and which leaks into waitingDeps forever),
|
|
20
|
+
* we signal corruption with a Symbol-keyed flag that cannot collide with any
|
|
21
|
+
* user data. The recovery path detects this flag and routes the job to the DLQ.
|
|
22
|
+
*
|
|
23
|
+
* A Symbol property is non-enumerable to JSON/msgpack and is never persisted,
|
|
24
|
+
* so it only exists on the in-memory Job for the duration of recovery.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CORRUPT_DEPENDS_ON: unique symbol;
|
|
27
|
+
/** True if a Job was recovered with a corrupt `depends_on` blob. */
|
|
28
|
+
export declare function isCorruptDependsOn(job: Job): boolean;
|
|
13
29
|
/** Convert database row to Job object */
|
|
14
30
|
export declare function rowToJob(row: DbJob): Job;
|
|
15
31
|
/** Reconstruct DlqEntry from MessagePack-decoded data */
|
|
16
32
|
export declare function reconstructDlqEntry(entry: DlqEntry): DlqEntry;
|
|
17
|
-
//# sourceMappingURL=sqliteSerializer.d.ts.map
|
|
@@ -22,17 +22,58 @@ export function unpack(buffer, fallback, context) {
|
|
|
22
22
|
return fallback;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Symbol marker stamped on a Job whose `depends_on` blob failed to decode.
|
|
27
|
+
*
|
|
28
|
+
* A corrupt dependency list must NOT collapse into `dependsOn: []` (which the
|
|
29
|
+
* recovery path treats as "ready, no deps" -> out-of-order execution). Rather
|
|
30
|
+
* than parking the job behind a magic-string dependency (which could collide
|
|
31
|
+
* with a real user-supplied jobId, and which leaks into waitingDeps forever),
|
|
32
|
+
* we signal corruption with a Symbol-keyed flag that cannot collide with any
|
|
33
|
+
* user data. The recovery path detects this flag and routes the job to the DLQ.
|
|
34
|
+
*
|
|
35
|
+
* A Symbol property is non-enumerable to JSON/msgpack and is never persisted,
|
|
36
|
+
* so it only exists on the in-memory Job for the duration of recovery.
|
|
37
|
+
*/
|
|
38
|
+
export const CORRUPT_DEPENDS_ON = Symbol('bunqueue.corruptDependsOn');
|
|
39
|
+
/** True if a Job was recovered with a corrupt `depends_on` blob. */
|
|
40
|
+
export function isCorruptDependsOn(job) {
|
|
41
|
+
return job[CORRUPT_DEPENDS_ON] === true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Decode a job's `depends_on` blob, distinguishing a genuine decode FAILURE
|
|
45
|
+
* from a legitimately empty list. On decode failure, returns `corrupt: true`
|
|
46
|
+
* (with empty ids) instead of silently swallowing it into a healthy empty array.
|
|
47
|
+
*/
|
|
48
|
+
function decodeDependsOn(buffer, context) {
|
|
49
|
+
if (!buffer)
|
|
50
|
+
return { ids: [], corrupt: false };
|
|
51
|
+
try {
|
|
52
|
+
return { ids: msgpackDecode(buffer), corrupt: false };
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
storageLog.error('Corrupt depends_on blob (routing job to DLQ)', {
|
|
56
|
+
context,
|
|
57
|
+
error: String(err),
|
|
58
|
+
});
|
|
59
|
+
return { ids: [], corrupt: true };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
25
62
|
/** Convert database row to Job object */
|
|
26
63
|
export function rowToJob(row) {
|
|
27
64
|
const jobContext = `rowToJob:${row.id}`;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
65
|
+
// A corrupt depends_on blob must NOT be silently swallowed into [] (which the
|
|
66
|
+
// recovery path treats as "ready, no deps" -> out-of-order execution).
|
|
67
|
+
// decodeDependsOn() surfaces the corruption via a `corrupt` flag; we then
|
|
68
|
+
// stamp the returned Job with the CORRUPT_DEPENDS_ON symbol so the recovery
|
|
69
|
+
// path can route it to the DLQ instead of enqueuing it as ready.
|
|
70
|
+
const decoded = decodeDependsOn(row.depends_on, `${jobContext}:dependsOn`);
|
|
71
|
+
const dependsOn = decoded.ids;
|
|
31
72
|
const childrenIds = row.children_ids
|
|
32
73
|
? unpack(row.children_ids, [], `${jobContext}:childrenIds`)
|
|
33
74
|
: [];
|
|
34
75
|
const tags = row.tags ? unpack(row.tags, [], `${jobContext}:tags`) : [];
|
|
35
|
-
|
|
76
|
+
const job = {
|
|
36
77
|
id: jobId(row.id),
|
|
37
78
|
queue: row.queue,
|
|
38
79
|
data: unpack(row.data, {}, `${jobContext}:data`),
|
|
@@ -81,6 +122,30 @@ export function rowToJob(row) {
|
|
|
81
122
|
? unpack(row.timeline, [], `${jobContext}:timeline`)
|
|
82
123
|
: [],
|
|
83
124
|
};
|
|
125
|
+
// Stamp a collision-proof corruption marker (non-enumerable Symbol, never
|
|
126
|
+
// persisted) so the recovery path routes this job to the DLQ rather than
|
|
127
|
+
// enqueuing it as ready. We keep dependsOn: [] here — the real deps are
|
|
128
|
+
// unrecoverable — but the marker prevents out-of-order execution.
|
|
129
|
+
if (decoded.corrupt) {
|
|
130
|
+
Object.defineProperty(job, CORRUPT_DEPENDS_ON, {
|
|
131
|
+
value: true,
|
|
132
|
+
enumerable: false,
|
|
133
|
+
configurable: true,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return job;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Brand a decoded id as a JobId, preserving its runtime type.
|
|
140
|
+
*
|
|
141
|
+
* Production ids are UUIDv7 strings (identity). msgpackr faithfully round-trips
|
|
142
|
+
* the original runtime type (including bigint), so we only stringify when the
|
|
143
|
+
* decoded value is genuinely non-string rather than unconditionally coercing —
|
|
144
|
+
* which would otherwise rewrite a recovered job's id and break id equality on
|
|
145
|
+
* the critical-loss -> DLQ -> restart recovery path.
|
|
146
|
+
*/
|
|
147
|
+
function brandId(id) {
|
|
148
|
+
return typeof id === 'string' ? jobId(id) : id;
|
|
84
149
|
}
|
|
85
150
|
/** Reconstruct DlqEntry from MessagePack-decoded data */
|
|
86
151
|
export function reconstructDlqEntry(entry) {
|
|
@@ -88,11 +153,10 @@ export function reconstructDlqEntry(entry) {
|
|
|
88
153
|
...entry,
|
|
89
154
|
job: {
|
|
90
155
|
...entry.job,
|
|
91
|
-
id:
|
|
92
|
-
dependsOn: entry.job.dependsOn.map((id) =>
|
|
93
|
-
parentId: entry.job.parentId ?
|
|
94
|
-
childrenIds: entry.job.childrenIds.map((id) =>
|
|
156
|
+
id: brandId(entry.job.id),
|
|
157
|
+
dependsOn: entry.job.dependsOn.map((id) => brandId(id)),
|
|
158
|
+
parentId: entry.job.parentId !== null ? brandId(entry.job.parentId) : null,
|
|
159
|
+
childrenIds: entry.job.childrenIds.map((id) => brandId(id)),
|
|
95
160
|
},
|
|
96
161
|
};
|
|
97
162
|
}
|
|
98
|
-
//# sourceMappingURL=sqliteSerializer.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { Database } from 'bun:sqlite';
|
|
6
6
|
/** Statement names */
|
|
7
|
-
export type StatementName = 'insertJob' | 'updateJobState' | 'completeJob' | 'deleteJob' | 'getJob' | 'insertResult' | 'getResult' | 'insertDlq' | 'loadDlq' | 'deleteDlqEntry' | 'clearDlqQueue' | 'insertCron' | 'updateCron';
|
|
7
|
+
export type StatementName = 'insertJob' | 'updateJobState' | 'completeJob' | 'deleteJob' | 'deleteJobResult' | 'getJob' | 'insertResult' | 'getResult' | 'insertDlq' | 'loadDlq' | 'deleteDlqEntry' | 'clearDlqQueue' | 'insertCron' | 'updateCron';
|
|
8
8
|
/** SQL statements */
|
|
9
9
|
export declare const SQL_STATEMENTS: Record<StatementName, string>;
|
|
10
10
|
/** Prepare all statements */
|
|
@@ -58,5 +58,5 @@ export interface DbCron {
|
|
|
58
58
|
skip_missed_on_restart: number;
|
|
59
59
|
skip_if_no_worker: number;
|
|
60
60
|
prevent_overlap: number;
|
|
61
|
+
job_options: Uint8Array | null;
|
|
61
62
|
}
|
|
62
|
-
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -20,6 +20,7 @@ export const SQL_STATEMENTS = {
|
|
|
20
20
|
updateJobState: 'UPDATE jobs SET state = ?, started_at = ?, timeline = ? WHERE id = ?',
|
|
21
21
|
completeJob: 'UPDATE jobs SET state = ?, completed_at = ?, progress = 100, timeline = ? WHERE id = ?',
|
|
22
22
|
deleteJob: 'DELETE FROM jobs WHERE id = ?',
|
|
23
|
+
deleteJobResult: 'DELETE FROM job_results WHERE job_id = ?',
|
|
23
24
|
getJob: 'SELECT * FROM jobs WHERE id = ?',
|
|
24
25
|
insertResult: 'INSERT OR REPLACE INTO job_results (job_id, result, completed_at) VALUES (?, ?, ?)',
|
|
25
26
|
getResult: 'SELECT result FROM job_results WHERE job_id = ?',
|
|
@@ -29,8 +30,8 @@ export const SQL_STATEMENTS = {
|
|
|
29
30
|
clearDlqQueue: 'DELETE FROM dlq WHERE queue = ?',
|
|
30
31
|
insertCron: `
|
|
31
32
|
INSERT OR REPLACE INTO cron_jobs
|
|
32
|
-
(name, queue, data, schedule, repeat_every, priority, next_run, executions, max_limit, timezone, unique_key, dedup, skip_missed_on_restart, skip_if_no_worker, prevent_overlap)
|
|
33
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
33
|
+
(name, queue, data, schedule, repeat_every, priority, next_run, executions, max_limit, timezone, unique_key, dedup, skip_missed_on_restart, skip_if_no_worker, prevent_overlap, job_options)
|
|
34
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
34
35
|
`,
|
|
35
36
|
updateCron: 'UPDATE cron_jobs SET executions = ?, next_run = ? WHERE name = ?',
|
|
36
37
|
};
|
|
@@ -42,4 +43,3 @@ export function prepareStatements(db) {
|
|
|
42
43
|
}
|
|
43
44
|
return statements;
|
|
44
45
|
}
|
|
45
|
-
//# sourceMappingURL=statements.js.map
|