@yrpri/api 9.0.195 → 9.0.197

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/models/audio.cjs CHANGED
@@ -6,7 +6,7 @@ const queue = require('../services/workers/queue.cjs');
6
6
  let bullAudioQueue;
7
7
  if (process.env.USE_YOUR_PRIORITIES_ENCODER) {
8
8
  const { Queue } = require('bullmq');
9
- let redisUrl = process.env.REDIS_URL ? process.env.REDIS_URL : "redis://localhost:6379";
9
+ let redisUrl = process.env.REDIS_WORKER_URL ?? process.env.REDIS_URL ?? "redis://localhost:6379";
10
10
  if (redisUrl.startsWith("redis://h:")) {
11
11
  redisUrl = redisUrl.replace("redis://h:", "redis://:");
12
12
  }
package/models/video.cjs CHANGED
@@ -7,7 +7,7 @@ const queue = require("../services/workers/queue.cjs");
7
7
  let bullVideoQueue;
8
8
  if (process.env.USE_YOUR_PRIORITIES_ENCODER) {
9
9
  const { Queue } = require("bullmq");
10
- let redisUrl = process.env.REDIS_URL ? process.env.REDIS_URL : "redis://localhost:6379";
10
+ let redisUrl = process.env.REDIS_WORKER_URL ?? process.env.REDIS_URL ?? "redis://localhost:6379";
11
11
  if (redisUrl.startsWith("redis://h:")) {
12
12
  redisUrl = redisUrl.replace("redis://h:", "redis://:");
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yrpri/api",
3
- "version": "9.0.195",
3
+ "version": "9.0.197",
4
4
  "license": "MIT",
5
5
  "author": "Robert Bjarnason & Citizens Foundation",
6
6
  "repository": {
@@ -7,7 +7,7 @@ if (process.env.AIRBRAKE_PROJECT_ID) {
7
7
  }
8
8
  // make sure we use the Heroku Redis To Go URL
9
9
  // (put REDISTOGO_URL=redis://localhost:6379 in .env for local testing)
10
- var redisUrl = process.env.REDIS_URL ? process.env.REDIS_URL : "redis://localhost:6379";
10
+ var redisUrl = process.env.REDIS_WORKER_URL ?? process.env.REDIS_URL ?? "redis://localhost:6379";
11
11
  log.info("Starting app access to Kue Queue", { redis_url: redisUrl });
12
12
  var queue = kue.createQueue({
13
13
  redis: redisUrl,
@@ -9,7 +9,7 @@ if (process.env.AIRBRAKE_PROJECT_ID) {
9
9
  }
10
10
  // make sure we use the Heroku Redis To Go URL
11
11
  // (put REDISTOGO_URL=redis://localhost:6379 in .env for local testing)
12
- var redisUrl = process.env.REDIS_URL ? process.env.REDIS_URL : "redis://localhost:6379";
12
+ var redisUrl = process.env.REDIS_WORKER_URL ?? process.env.REDIS_URL ?? "redis://localhost:6379";
13
13
  log.info("Starting app access to Kue Queue", { redis_url: redisUrl });
14
14
  var queue = kue.createQueue({
15
15
  redis: redisUrl,
@@ -6,7 +6,7 @@ if (process.env.AIRBRAKE_PROJECT_ID) {
6
6
  airbrake = require('../utils/airbrake.cjs');
7
7
  }
8
8
  const { Queue, Worker } = require('bullmq');
9
- let redisUrl = process.env.REDIS_URL ? process.env.REDIS_URL : "redis://localhost:6379";
9
+ let redisUrl = process.env.REDIS_WORKER_URL ?? process.env.REDIS_URL ?? "redis://localhost:6379";
10
10
  if (redisUrl.startsWith("redis://h:")) {
11
11
  redisUrl = redisUrl.replace("redis://h:", "redis://:");
12
12
  }
@@ -27,14 +27,17 @@ if (redisUrl.startsWith("rediss://")) {
27
27
  };
28
28
  }
29
29
  log.info("Starting app access to BullMQ Queue", { redis_url: redisUrl });
30
- MAIN_WORKER_QUEUE_NAME = process.env.MAIN_WORKER_QUEUE_NAME || 'mainYpQueue';
30
+ const queuePrefix = process.env.MAIN_WORKER_QUEUE_NAME ||
31
+ process.env.MAIN_QUEUE_NAME ||
32
+ process.env.BULL_PREFIX ||
33
+ 'mainYpQueue';
31
34
  class YpQueue {
32
35
  constructor() {
33
36
  log.info("Create YpQueue");
34
37
  this.processors = new Map(); // Store processors per job name
35
38
  this.workers = new Map(); // Store workers per job name
36
39
  this.queues = new Map(); // Store queues per job name
37
- this.queuePrefix = MAIN_WORKER_QUEUE_NAME;
40
+ this.queuePrefix = queuePrefix;
38
41
  }
39
42
  get defaultJobOptions() {
40
43
  return {
@@ -4,7 +4,7 @@ declare class YpQueue {
4
4
  processors: Map<any, any>;
5
5
  workers: Map<any, any>;
6
6
  queues: Map<any, any>;
7
- queuePrefix: any;
7
+ queuePrefix: string;
8
8
  get defaultJobOptions(): {
9
9
  attempts: number;
10
10
  removeOnComplete: boolean;