@dudousxd/nestjs-durable 0.67.0 → 0.68.0

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/dist/index.d.cts CHANGED
@@ -1123,6 +1123,19 @@ interface DurableModuleSharedOptions {
1123
1123
  * single call — reserved here for when per-name concurrency lands there.
1124
1124
  */
1125
1125
  concurrencyByHandler?: Record<string, ConcurrencyOption>;
1126
+ /**
1127
+ * BullMQ `lockDuration` (ms) of a worker role's consumer (co-located or thin). Defaults to 5 min.
1128
+ * It also bounds how soon a task held by a worker that died can be redelivered (BullMQ redelivers
1129
+ * only once the lock lapses), so lower it to recover a crashed worker's turn sooner; keep it well
1130
+ * above the longest event-loop stall a healthy turn can cause. Ignored for a plain operator.
1131
+ */
1132
+ lockDuration?: number;
1133
+ /** BullMQ `stalledInterval` (ms) of a worker role's consumer: how often it checks for stalled jobs.
1134
+ * Omitted: BullMQ's default (30 s). Ignored for a plain operator. */
1135
+ stalledInterval?: number;
1136
+ /** BullMQ `maxStalledCount` of a worker role's consumer: how often a job may stall before BullMQ
1137
+ * fails it for good. Omitted: BullMQ's default (1). Ignored for a plain operator. */
1138
+ maxStalledCount?: number;
1126
1139
  /** Timeout for a thin worker's `RunGateway` round-trip over `transport` before it rejects. Defaults
1127
1140
  * to 10_000ms inside `ProxyRunGateway`. Ignored for an operator (bound to `StoreRunGateway`). */
1128
1141
  runGatewayTimeoutMs?: number;
package/dist/index.d.ts CHANGED
@@ -1123,6 +1123,19 @@ interface DurableModuleSharedOptions {
1123
1123
  * single call — reserved here for when per-name concurrency lands there.
1124
1124
  */
1125
1125
  concurrencyByHandler?: Record<string, ConcurrencyOption>;
1126
+ /**
1127
+ * BullMQ `lockDuration` (ms) of a worker role's consumer (co-located or thin). Defaults to 5 min.
1128
+ * It also bounds how soon a task held by a worker that died can be redelivered (BullMQ redelivers
1129
+ * only once the lock lapses), so lower it to recover a crashed worker's turn sooner; keep it well
1130
+ * above the longest event-loop stall a healthy turn can cause. Ignored for a plain operator.
1131
+ */
1132
+ lockDuration?: number;
1133
+ /** BullMQ `stalledInterval` (ms) of a worker role's consumer: how often it checks for stalled jobs.
1134
+ * Omitted: BullMQ's default (30 s). Ignored for a plain operator. */
1135
+ stalledInterval?: number;
1136
+ /** BullMQ `maxStalledCount` of a worker role's consumer: how often a job may stall before BullMQ
1137
+ * fails it for good. Omitted: BullMQ's default (1). Ignored for a plain operator. */
1138
+ maxStalledCount?: number;
1126
1139
  /** Timeout for a thin worker's `RunGateway` round-trip over `transport` before it rejects. Defaults
1127
1140
  * to 10_000ms inside `ProxyRunGateway`. Ignored for an operator (bound to `StoreRunGateway`). */
1128
1141
  runGatewayTimeoutMs?: number;
package/dist/index.js CHANGED
@@ -1481,6 +1481,15 @@ var ThinWorkerBootstrap = class {
1481
1481
  ...options.concurrency !== void 0 ? {
1482
1482
  concurrency: options.concurrency
1483
1483
  } : {},
1484
+ ...options.lockDuration !== void 0 ? {
1485
+ lockDuration: options.lockDuration
1486
+ } : {},
1487
+ ...options.stalledInterval !== void 0 ? {
1488
+ stalledInterval: options.stalledInterval
1489
+ } : {},
1490
+ ...options.maxStalledCount !== void 0 ? {
1491
+ maxStalledCount: options.maxStalledCount
1492
+ } : {},
1484
1493
  // Announce the app's schedules (an empty list too) so the control plane adopts, updates and
1485
1494
  // withdraws them: a tenant has no store to fire them from.
1486
1495
  ...await tenantScheduleAnnouncement(options, this.auth.tenantToken)
@@ -1835,6 +1844,15 @@ var InAppWorkerBootstrap = class {
1835
1844
  } : {},
1836
1845
  ...options.concurrency !== void 0 ? {
1837
1846
  concurrency: options.concurrency
1847
+ } : {},
1848
+ ...options.lockDuration !== void 0 ? {
1849
+ lockDuration: options.lockDuration
1850
+ } : {},
1851
+ ...options.stalledInterval !== void 0 ? {
1852
+ stalledInterval: options.stalledInterval
1853
+ } : {},
1854
+ ...options.maxStalledCount !== void 0 ? {
1855
+ maxStalledCount: options.maxStalledCount
1838
1856
  } : {}
1839
1857
  });
1840
1858
  this.runners.push(handle);