@chevre/domain 22.9.0-alpha.53 → 22.9.0-alpha.54

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.
@@ -182,6 +182,15 @@ const indexes = [
182
182
  lastTriedAt: { $type: 'date' }
183
183
  }
184
184
  }
185
+ ],
186
+ [
187
+ { status: 1, expires: 1 },
188
+ {
189
+ name: 'makeExpiredMany',
190
+ partialFilterExpression: {
191
+ expires: { $exists: true }
192
+ }
193
+ }
185
194
  ]
186
195
  ];
187
196
  exports.indexes = indexes;
@@ -699,6 +699,9 @@ class TransactionRepo {
699
699
  makeOneExpiredIfExists(params) {
700
700
  return __awaiter(this, void 0, void 0, function* () {
701
701
  const endDate = new Date();
702
+ const sort = {
703
+ startDate: factory.sortType.Ascending
704
+ };
702
705
  const doc = yield this.transactionModel.findOneAndUpdate({
703
706
  status: { $eq: factory.transactionStatusType.InProgress },
704
707
  expires: { $lt: params.expires.$lt }
@@ -713,6 +716,7 @@ class TransactionRepo {
713
716
  typeOf: 1
714
717
  }
715
718
  })
719
+ .sort(sort)
716
720
  .lean()
717
721
  .exec();
718
722
  if (doc === null) {
package/package.json CHANGED
@@ -112,5 +112,5 @@
112
112
  "postversion": "git push origin --tags",
113
113
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
114
114
  },
115
- "version": "22.9.0-alpha.53"
115
+ "version": "22.9.0-alpha.54"
116
116
  }