@riocrypto/common-server 1.0.2920 → 1.0.2922

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.
@@ -77,6 +77,21 @@ const buildAlfinWithdrawal = (mongoose) => {
77
77
  },
78
78
  },
79
79
  });
80
+ // Nothing here was indexed, so the background workers below were reading the
81
+ // whole collection every few seconds. Both indexes are multikey over the
82
+ // parts array, which is allowed because the fields belong to the same array
83
+ // rather than to parallel ones.
84
+ // Settlement reconciliation and treasury part submission both hunt for parts
85
+ // sitting in `processing`, on a timer, forever. Parts in that state are a
86
+ // small minority of a collection that only grows, which is what makes the
87
+ // scan worth removing.
88
+ AlfinWithdrawalSchema.index({
89
+ "AlfinWithdrawals.status": 1,
90
+ "AlfinWithdrawals.statusCheckAfter": 1,
91
+ });
92
+ // The treasury import reads the recent internal transfers on every run, to
93
+ // recognise the statement lines of transfers Rio sent itself.
94
+ AlfinWithdrawalSchema.index({ type: 1, createdAt: -1 });
80
95
  AlfinWithdrawalSchema.statics.build = (attrs) => {
81
96
  return new AlfinWithdrawal(attrs);
82
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2920",
3
+ "version": "1.0.2922",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",