MonqueTsedConfig
Defined in: tsed/src/config/types.ts:27
Configuration options for @monque/tsed.
Extends MonqueOptions with Ts.ED-specific settings for database resolution and module behavior.
Example
Section titled “Example”Extends
Section titled “Extends”MonqueOptions
Properties
Section titled “Properties”baseRetryInterval?
Section titled “baseRetryInterval?”Defined in: core/dist/index.d.mts:664
Base interval in milliseconds for exponential backoff calculation. Actual delay = 2^failCount * baseRetryInterval
Default
Section titled “Default”Inherited from
Section titled “Inherited from”collectionName?
Section titled “collectionName?”Defined in: core/dist/index.d.mts:648
Name of the MongoDB collection for storing jobs.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”Defined in: tsed/src/config/types.ts:55
Direct MongoDB database instance.
Use when you have a pre-connected Db object available synchronously.
Example
Section titled “Example”dbFactory()?
Section titled “dbFactory()?”Defined in: tsed/src/config/types.ts:75
Factory function to create the database connection.
Called once during module initialization. Supports async factories for connection pooling or lazy initialization.
Returns
Section titled “Returns”Db | Promise<Db>
Example
Section titled “Example”dbToken?
Section titled “dbToken?”Defined in: tsed/src/config/types.ts:104
DI token to inject the Db instance from the container.
Use when your application already has a MongoDB provider registered in the DI container.
Can also be used to inject a MongooseService or Connection.
Example
Section titled “Example”defaultConcurrency?
Section titled “defaultConcurrency?”Defined in: core/dist/index.d.mts:693
Default number of concurrent jobs per worker.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”disableJobProcessing?
Section titled “disableJobProcessing?”Defined in: tsed/src/config/types.ts:146
Disable job processing on this instance.
When true, the module will initialize the database connection (allowing you to enqueue jobs via MonqueService) but will NOT register jobs or start the polling loop. Useful for “Producer-only” nodes like API servers that only enqueue jobs but don’t process them.
Example
Section titled “Example”Default
Section titled “Default”enabled?
Section titled “enabled?”Defined in: tsed/src/config/types.ts:38
Enable or disable the Monque module.
When disabled:
- Jobs are not registered
- Lifecycle hooks are no-ops
- MonqueService throws on access
Default
Section titled “Default”heartbeatInterval?
Section titled “heartbeatInterval?”Defined in: core/dist/index.d.mts:718
Interval in milliseconds for heartbeat updates during job processing.
The scheduler periodically updates lastHeartbeat for all jobs it is processing
to indicate liveness for monitoring/debugging.
Note: stale recovery is based on lockedAt + lockTimeout, not lastHeartbeat.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”instanceConcurrency?
Section titled “instanceConcurrency?”Defined in: core/dist/index.d.mts:766
Maximum number of concurrent jobs processed by this instance across all registered workers.
If reached, the scheduler will stop claiming new jobs until active jobs complete. Use this to prevent a single instance from overwhelming system resources.
Note: This is an instance-level limit. Each worker still respects its own concurrency
setting, but the total across all workers cannot exceed this limit.
Example
Section titled “Example”Inherited from
Section titled “Inherited from”jobRetention?
Section titled “jobRetention?”Defined in: core/dist/index.d.mts:729
Configuration for automatic cleanup of completed and failed jobs. If undefined, no cleanup is performed.
completed?
Section titled “completed?”Age in milliseconds after which completed jobs are deleted. Cleaned up based on ‘updatedAt’ timestamp.
failed?
Section titled “failed?”Age in milliseconds after which failed jobs are deleted. Cleaned up based on ‘updatedAt’ timestamp.
interval?
Section titled “interval?”Interval in milliseconds for running the cleanup job.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”lockTimeout?
Section titled “lockTimeout?”Defined in: core/dist/index.d.mts:702
Maximum time in milliseconds a job can be in ‘processing’ status before being considered stale and eligible for recovery.
Stale recovery uses lockedAt as the source of truth; this is an absolute
“time locked” limit, not a heartbeat timeout.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”maxBackoffDelay?
Section titled “maxBackoffDelay?”Defined in: core/dist/index.d.mts:672
Maximum delay in milliseconds for exponential backoff. If calculated delay exceeds this value, it will be capped.
Defaults to 24 hours to prevent unbounded delays.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”maxConcurrency?
Section titled “maxConcurrency?”Defined in: core/dist/index.d.mts:772
Maximum number of concurrent jobs processed by this instance across all registered workers.
Inherited from
Section titled “Inherited from”maxRetries?
Section titled “maxRetries?”Defined in: core/dist/index.d.mts:658
Maximum number of retry attempts before marking a job as permanently failed.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”mongooseConnectionId?
Section titled “mongooseConnectionId?”Defined in: tsed/src/config/types.ts:113
Connection ID of the Mongoose connection to use.
Requires the use of dbToken pointing to MongooseService.
Default
Section titled “Default”pollInterval?
Section titled “pollInterval?”Defined in: core/dist/index.d.mts:653
Interval in milliseconds between polling for new jobs.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”recoverStaleJobs?
Section titled “recoverStaleJobs?”Defined in: core/dist/index.d.mts:724
Whether to recover stale processing jobs on scheduler startup. When true, jobs with lockedAt older than lockTimeout will be reset to pending.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”schedulerInstanceId?
Section titled “schedulerInstanceId?”Defined in: core/dist/index.d.mts:709
Unique identifier for this scheduler instance. Used for atomic job claiming - each instance uses this ID to claim jobs. Defaults to a randomly generated UUID v4.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”shutdownTimeout?
Section titled “shutdownTimeout?”Defined in: core/dist/index.d.mts:677
Timeout in milliseconds for graceful shutdown.
Default
Section titled “Default”Inherited from
Section titled “Inherited from”workerConcurrency?
Section titled “workerConcurrency?”Defined in: core/dist/index.d.mts:686
Default number of concurrent jobs per worker.
This is the per-worker concurrency limit applied when a worker is registered
without specifying its own concurrency option.