@chevre/domain 21.2.0-alpha.43 → 21.2.0-alpha.45
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.
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
4
|
interface IListenArgsOnTaskStatusChanged {
|
|
5
|
-
id
|
|
6
|
-
name
|
|
5
|
+
id: string;
|
|
6
|
+
name?: factory.taskName;
|
|
7
7
|
status: factory.taskStatus;
|
|
8
8
|
}
|
|
9
9
|
type IOnTaskStatusChangedListener = (listenArgs: IListenArgsOnTaskStatusChanged) => void;
|
|
@@ -509,7 +509,7 @@ class MongoRepository {
|
|
|
509
509
|
yield this.transactionModel.updateMany({
|
|
510
510
|
_id: { $in: expiringTransactions.map((t) => t.id) },
|
|
511
511
|
status: { $eq: factory.transactionStatusType.InProgress },
|
|
512
|
-
expires: { $lt: params.expires }
|
|
512
|
+
expires: { $lt: params.expires.$lt }
|
|
513
513
|
}, {
|
|
514
514
|
status: factory.transactionStatusType.Expired,
|
|
515
515
|
endDate: new Date()
|
package/lib/chevre/repo/task.js
CHANGED
|
@@ -163,12 +163,18 @@ class MongoRepository {
|
|
|
163
163
|
return { id: objectId.toHexString() };
|
|
164
164
|
});
|
|
165
165
|
if (emitImmediately) {
|
|
166
|
-
|
|
166
|
+
savedTasks.forEach((savedTask) => {
|
|
167
167
|
task_2.taskEventEmitter.emitTaskStatusChanged({
|
|
168
|
-
|
|
168
|
+
id: savedTask.id,
|
|
169
169
|
status: factory.taskStatus.Ready
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
|
+
// taskAttributes.forEach((savedTask) => {
|
|
173
|
+
// taskEventEmitter.emitTaskStatusChanged({
|
|
174
|
+
// name: savedTask.name,
|
|
175
|
+
// status: factory.taskStatus.Ready
|
|
176
|
+
// });
|
|
177
|
+
// });
|
|
172
178
|
}
|
|
173
179
|
// return result.ops;
|
|
174
180
|
return savedTasks;
|
|
@@ -613,7 +613,7 @@ class MongoRepository {
|
|
|
613
613
|
yield this.transactionModel.updateMany({
|
|
614
614
|
_id: { $in: expiringTransactions.map((t) => t.id) },
|
|
615
615
|
status: { $eq: factory.transactionStatusType.InProgress },
|
|
616
|
-
expires: { $lt: params.expires }
|
|
616
|
+
expires: { $lt: params.expires.$lt }
|
|
617
617
|
}, {
|
|
618
618
|
status: factory.transactionStatusType.Expired,
|
|
619
619
|
endDate: new Date()
|
package/package.json
CHANGED