@trigger.dev/redis-worker 0.0.0-prerelease-deployment-base-image-20260814120901 → 0.0.0-prerelease-local-bundle-20260825080823

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.cjs CHANGED
@@ -9646,22 +9646,28 @@ function createRedisClient(options, handlers) {
9646
9646
  }
9647
9647
 
9648
9648
  //#endregion
9649
- //#region ../../node_modules/.pnpm/nanoid@5.1.2/node_modules/nanoid/url-alphabet/index.js
9650
- const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
9649
+ //#region ../../node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js
9650
+ let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
9651
9651
 
9652
9652
  //#endregion
9653
- //#region ../../node_modules/.pnpm/nanoid@5.1.2/node_modules/nanoid/index.js
9653
+ //#region ../../node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.js
9654
9654
  const POOL_SIZE_MULTIPLIER = 128;
9655
9655
  let pool;
9656
9656
  let poolOffset;
9657
9657
  function fillPool(bytes) {
9658
- if (!pool || pool.length < bytes) {
9659
- pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
9660
- node_crypto.webcrypto.getRandomValues(pool);
9661
- poolOffset = 0;
9662
- } else if (poolOffset + bytes > pool.length) {
9663
- node_crypto.webcrypto.getRandomValues(pool);
9664
- poolOffset = 0;
9658
+ if (bytes < 0) throw new RangeError("Wrong ID size");
9659
+ try {
9660
+ if (!pool || pool.length < bytes) {
9661
+ pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
9662
+ node_crypto.webcrypto.getRandomValues(pool);
9663
+ poolOffset = 0;
9664
+ } else if (poolOffset + bytes > pool.length) {
9665
+ node_crypto.webcrypto.getRandomValues(pool);
9666
+ poolOffset = 0;
9667
+ }
9668
+ } catch (e) {
9669
+ pool = void 0;
9670
+ throw e;
9665
9671
  }
9666
9672
  poolOffset += bytes;
9667
9673
  }
@@ -12076,12 +12082,21 @@ var Worker = class Worker {
12076
12082
  }
12077
12083
  this.isShuttingDown = true;
12078
12084
  this.logger.log("Shutting down worker loops...", { signal });
12079
- await Promise.race([Promise.all(this.workerLoops), Worker.delay(this.shutdownTimeoutMs).then(() => {
12080
- this.logger.error("Worker shutdown timed out", {
12081
- signal,
12082
- shutdownTimeoutMs: this.shutdownTimeoutMs
12083
- });
12084
- })]);
12085
+ let shutdownDeadline;
12086
+ const deadlinePromise = new Promise((resolve) => {
12087
+ shutdownDeadline = setTimeout(() => {
12088
+ this.logger.error("Worker shutdown timed out", {
12089
+ signal,
12090
+ shutdownTimeoutMs: this.shutdownTimeoutMs
12091
+ });
12092
+ resolve();
12093
+ }, this.shutdownTimeoutMs);
12094
+ });
12095
+ try {
12096
+ await Promise.race([Promise.all(this.workerLoops), deadlinePromise]);
12097
+ } finally {
12098
+ if (shutdownDeadline) clearTimeout(shutdownDeadline);
12099
+ }
12085
12100
  await this.subscriber?.unsubscribe();
12086
12101
  await this.subscriber?.quit();
12087
12102
  await this.queue.close();
@@ -13899,7 +13914,7 @@ var WorkerQueueManager = class {
13899
13914
  throw error;
13900
13915
  } finally {
13901
13916
  if (cleanup && signal) signal.removeEventListener("abort", cleanup);
13902
- await blockingClient.quit().catch(() => {});
13917
+ if (blockingClient.status !== "end") await blockingClient.quit().catch(() => {});
13903
13918
  }
13904
13919
  }
13905
13920
  /**