@alanszp/queue 15.0.4 → 16.0.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.
@@ -8,15 +8,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.withContext = void 0;
13
16
  const cuid2_1 = require("@paralleldrive/cuid2");
14
17
  const core_1 = require("@alanszp/core");
15
18
  const lodash_1 = require("lodash");
19
+ const newrelic_1 = __importDefault(require("newrelic"));
16
20
  function withContext(queueName, workerContext, executor) {
17
21
  return (job) => {
18
22
  const { lid, lch } = job.data;
19
- return workerContext.sharedContext.run(() => __awaiter(this, void 0, void 0, function* () {
23
+ return workerContext.sharedContext.run((context) => __awaiter(this, void 0, void 0, function* () {
24
+ newrelic_1.default.addCustomAttributes({
25
+ lch: context.lifecycleChain,
26
+ lid: context.lifecycleId,
27
+ cid: context.contextId,
28
+ });
20
29
  return executor(job);
21
30
  }), {
22
31
  logger: workerContext.baseLogger,
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.js","sourceRoot":"","sources":["../../src/wrappers/withContext.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAChD,wCAA8C;AAI9C,mCAAiC;AAEjC,SAAgB,WAAW,CACzB,SAAiB,EACjB,aAA4B,EAC5B,QAA+C;IAE/C,OAAO,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,IAAsC,CAAC;QAChE,OAAO,aAAa,CAAC,aAAa,CAAC,GAAG,CACpC,GAAS,EAAE;YACT,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC,CAAA,EACD;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AC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAA,oBAAa,GAAE;YACjE,SAAS,EAAE,IAAA,gBAAQ,GAAE;SACtB,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AA3BD,kCA2BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alanszp/queue",
3
- "version": "15.0.4",
3
+ "version": "16.0.0",
4
4
  "description": "Workers and queues",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -16,6 +16,7 @@
16
16
  "yalc-publish": "yarn run yalc publish"
17
17
  },
18
18
  "devDependencies": {
19
+ "@types/newrelic": "^9.14.4",
19
20
  "@types/node": "^20.11.17",
20
21
  "class-validator": "^0.14.1",
21
22
  "ts-node": "^10.0.0",
@@ -23,15 +24,16 @@
23
24
  "typescript": "^4.3.4"
24
25
  },
25
26
  "dependencies": {
26
- "@alanszp/audit": "^15.0.4",
27
- "@alanszp/core": "^15.0.0",
28
- "@alanszp/logger": "^15.0.0",
29
- "@alanszp/shared-context": "^15.0.4",
30
- "@alanszp/validations": "^15.0.0",
27
+ "@alanszp/audit": "^16.0.0",
28
+ "@alanszp/core": "^16.0.0",
29
+ "@alanszp/logger": "^16.0.0",
30
+ "@alanszp/shared-context": "^16.0.0",
31
+ "@alanszp/validations": "^16.0.0",
31
32
  "@paralleldrive/cuid2": "^2.2.2",
32
33
  "bullmq": "^5.4.4",
33
34
  "ioredis": "^5.3.2",
34
- "lodash": "^4.17.21"
35
+ "lodash": "^4.17.21",
36
+ "newrelic": "^11.18.0"
35
37
  },
36
- "gitHead": "21554c6285f8c1f6d4aea93d4f9253033d7bf385"
38
+ "gitHead": "919bf4ac232e8b6fc8d6c3203bba5852ae3e1ac9"
37
39
  }