skyeye-svc-common-utils 0.0.205 → 0.0.206
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/package.json
CHANGED
|
@@ -35,7 +35,7 @@ export abstract class BaseController {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
async endTransaction(baseControllerParameter: BaseControllerParameter) {
|
|
38
|
+
async endTransaction(baseControllerParameter: BaseControllerParameter): Promise<any> {
|
|
39
39
|
try {
|
|
40
40
|
if(!baseControllerParameter.queryRunner) {
|
|
41
41
|
logger.warn(`BaseController/endTransaction: null / undefined queryRunner`);
|
|
@@ -80,11 +80,11 @@ export abstract class BaseController {
|
|
|
80
80
|
BaseController.mutex.runExclusive(async () => {
|
|
81
81
|
this.startTransaction().then((queryRunner: QueryRunner) => {
|
|
82
82
|
baseControllerParameter.queryRunner = queryRunner;
|
|
83
|
-
this.executeImpl(req.body, baseControllerParameter);
|
|
83
|
+
return this.executeImpl(req.body, baseControllerParameter);
|
|
84
84
|
}).then(() => {
|
|
85
|
-
this.endTransaction(baseControllerParameter);
|
|
85
|
+
return this.endTransaction(baseControllerParameter);
|
|
86
86
|
}).then(() => {
|
|
87
|
-
sendResponse(res, next, baseControllerParameter.serviceResponse);
|
|
87
|
+
return sendResponse(res, next, baseControllerParameter.serviceResponse);
|
|
88
88
|
}).catch((err: Error) => {
|
|
89
89
|
baseControllerParameter.serviceResponse.isSuccess = false;
|
|
90
90
|
this.endTransaction(baseControllerParameter).then(() => {
|
|
@@ -94,7 +94,7 @@ export abstract class BaseController {
|
|
|
94
94
|
});
|
|
95
95
|
} else {
|
|
96
96
|
this.executeImpl(req.body, baseControllerParameter).then(() => {
|
|
97
|
-
sendResponse(res, next, baseControllerParameter.serviceResponse);
|
|
97
|
+
return sendResponse(res, next, baseControllerParameter.serviceResponse);
|
|
98
98
|
}).catch((err: Error) => {
|
|
99
99
|
baseControllerParameter.serviceResponse.isSuccess = false;
|
|
100
100
|
next(err);
|
|
@@ -123,9 +123,9 @@ export abstract class BaseController {
|
|
|
123
123
|
BaseController.mutex.runExclusive(async () => {
|
|
124
124
|
this.startTransaction().then((queryRunner: QueryRunner) => {
|
|
125
125
|
baseControllerParameter.queryRunner = queryRunner;
|
|
126
|
-
this.executeImpl(call.request, baseControllerParameter);
|
|
126
|
+
return this.executeImpl(call.request, baseControllerParameter);
|
|
127
127
|
}).then(() => {
|
|
128
|
-
this.endTransaction(baseControllerParameter);
|
|
128
|
+
return this.endTransaction(baseControllerParameter);
|
|
129
129
|
}).then(() => {
|
|
130
130
|
return callback(null, baseControllerParameter.serviceResponse);
|
|
131
131
|
}).catch((err: Error) => {
|