@mondart/nestjs-common-module 1.1.66 → 1.1.67
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.
|
@@ -33,12 +33,18 @@ class SagaModule {
|
|
|
33
33
|
async execute(cmd) {
|
|
34
34
|
const sagaId = new Date().getTime().toString();
|
|
35
35
|
SagaModule.activeSagas.push(sagaId);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
try {
|
|
37
|
+
const s = await this.moduleRef.create(saga);
|
|
38
|
+
s.saga.bind(s);
|
|
39
|
+
return s.execute(cmd);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
const sagaIndex = SagaModule.activeSagas.findIndex((saga) => saga === sagaId);
|
|
46
|
+
sagaIndex && delete SagaModule.activeSagas[sagaIndex];
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
};
|
|
44
50
|
SagaCommandHandler = __decorate([
|