@chevre/domain 21.32.0-alpha.3 → 21.32.0-alpha.4
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.
|
@@ -16,13 +16,14 @@ const event_1 = require("../../repo/event");
|
|
|
16
16
|
const paymentService_1 = require("../../repo/paymentService");
|
|
17
17
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
18
18
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
19
|
+
const transactionProcess_1 = require("../../repo/transactionProcess");
|
|
19
20
|
const pay_1 = require("../assetTransaction/pay");
|
|
20
21
|
/**
|
|
21
22
|
* タスク実行関数
|
|
22
23
|
*/
|
|
23
24
|
function call(params) {
|
|
24
25
|
return (settings, options) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
var _a;
|
|
26
|
+
var _a, _b;
|
|
26
27
|
if (settings.redisClient === undefined) {
|
|
27
28
|
throw new factory.errors.Argument('settings', 'redisClient required');
|
|
28
29
|
}
|
|
@@ -31,6 +32,7 @@ function call(params) {
|
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
const actionRepo = new action_1.MongoRepository(settings.connection);
|
|
35
|
+
const transactionProcessRepo = new transactionProcess_1.TransactionProcessRepository(settings.redisClient, { lockExpiresInSeconds: 120 });
|
|
34
36
|
try {
|
|
35
37
|
yield (0, pay_1.check)(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id, typeOf: 'Task' } }))({
|
|
36
38
|
action: actionRepo,
|
|
@@ -54,7 +56,10 @@ function call(params) {
|
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
finally {
|
|
57
|
-
//
|
|
59
|
+
// 取引プロセスロック解除
|
|
60
|
+
if (typeof ((_b = params.data.purpose) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
61
|
+
yield transactionProcessRepo.unlock({ typeOf: params.data.purpose.typeOf, id: params.data.purpose.id });
|
|
62
|
+
}
|
|
58
63
|
}
|
|
59
64
|
});
|
|
60
65
|
}
|
package/package.json
CHANGED