@autofleet/rabbit 2.5.0 → 2.5.1

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.js CHANGED
@@ -256,8 +256,10 @@ class RabbitMq {
256
256
  return null;
257
257
  }
258
258
  const traceId = msg.properties.headers[TRACING_HEADER];
259
- const trace = outbreak_1.newTrace(outbreak_1.traceTypes.RABBIT);
260
- trace?.context?.set(TRACING_HEADER, traceId);
259
+ if (traceId) {
260
+ const trace = outbreak_1.newTrace(outbreak_1.traceTypes.RABBIT);
261
+ trace?.context?.set(TRACING_HEADER, traceId);
262
+ }
261
263
  const parsedMessage = RabbitMq.parseMsg(msg);
262
264
  const releaseLock = await this.lockRedisIfNeeded(parsedMessage, optionsWithDefaults);
263
265
  const shouldConsume = await this.shouldConsumeMessageByTimestamp(parsedMessage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -364,8 +364,10 @@ class RabbitMq implements IAfRabbitMq {
364
364
  }
365
365
 
366
366
  const traceId = msg.properties.headers[TRACING_HEADER];
367
- const trace = newTrace(traceTypes.RABBIT);
368
- (trace as any)?.context?.set(TRACING_HEADER, traceId);
367
+ if (traceId) {
368
+ const trace = newTrace(traceTypes.RABBIT);
369
+ (trace as any)?.context?.set(TRACING_HEADER, traceId);
370
+ }
369
371
 
370
372
  const parsedMessage = RabbitMq.parseMsg(msg);
371
373
  const releaseLock = await this.lockRedisIfNeeded(parsedMessage, optionsWithDefaults);