@coast/service-common 1.0.4 → 1.0.5
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.
|
@@ -11,14 +11,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
15
|
exports.TraceManager = void 0;
|
|
19
|
-
const uuid_1 = __importDefault(require("uuid"));
|
|
20
|
-
const common_1 = require("@nestjs/common");
|
|
21
16
|
const node_async_hooks_1 = require("node:async_hooks");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const uuid_1 = require("uuid");
|
|
22
19
|
const TraceId_1 = require("./TraceId");
|
|
23
20
|
let TraceManager = class TraceManager {
|
|
24
21
|
constructor(asyncLocalStorage) {
|
|
@@ -29,8 +26,8 @@ let TraceManager = class TraceManager {
|
|
|
29
26
|
}
|
|
30
27
|
withNewTrace(fn, traceId) {
|
|
31
28
|
const trace = {
|
|
32
|
-
traceId: traceId ?? (0, TraceId_1.TraceId)(uuid_1.
|
|
33
|
-
subtraceId: (0, TraceId_1.TraceId)(uuid_1.
|
|
29
|
+
traceId: traceId ?? (0, TraceId_1.TraceId)((0, uuid_1.v4)()),
|
|
30
|
+
subtraceId: (0, TraceId_1.TraceId)((0, uuid_1.v4)()),
|
|
34
31
|
};
|
|
35
32
|
return this.asyncLocalStorage.run(trace, fn);
|
|
36
33
|
}
|