@riocrypto/common-server 1.0.2886 → 1.0.2887
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.
|
@@ -88,6 +88,13 @@ const buildAdminTask = (mongoose) => {
|
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
});
|
|
91
|
+
// This collection carried no indexes while the admin-tasks crons polled it
|
|
92
|
+
// continuously, so every dedup check was a full scan. Each index below backs
|
|
93
|
+
// one of those recurring lookups.
|
|
94
|
+
AdminTaskSchema.index({ type: 1, status: 1, createdAt: 1 });
|
|
95
|
+
AdminTaskSchema.index({ type: 1, treasuryProvider: 1, status: 1, crypto: 1 });
|
|
96
|
+
AdminTaskSchema.index({ orderId: 1, type: 1, status: 1 });
|
|
97
|
+
AdminTaskSchema.index({ reference: 1, treasuryProvider: 1, type: 1 });
|
|
91
98
|
AdminTaskSchema.statics.build = (attrs) => {
|
|
92
99
|
return new AdminTask(attrs);
|
|
93
100
|
};
|
|
@@ -154,6 +154,20 @@ const buildInternalTransfer = (mongoose) => {
|
|
|
154
154
|
"origin.provider": 1,
|
|
155
155
|
"counterpartyLookup.nextAttemptAt": 1,
|
|
156
156
|
});
|
|
157
|
+
// The pending-transfer sweeps run every 5 seconds and filter on a leg's status
|
|
158
|
+
// alone. The (provider, providerId) indexes above cannot serve them because
|
|
159
|
+
// status is not a prefix, so each run scanned the entire collection to return
|
|
160
|
+
// nothing.
|
|
161
|
+
InternalTransferSchema.index({ "origin.status": 1 });
|
|
162
|
+
InternalTransferSchema.index({ "destination.status": 1 });
|
|
163
|
+
// Dedup lookups performed by the exchange import crons, which narrow to one
|
|
164
|
+
// provider and status before walking back through createdAt.
|
|
165
|
+
InternalTransferSchema.index({
|
|
166
|
+
"destination.provider": 1,
|
|
167
|
+
"destination.status": 1,
|
|
168
|
+
isImported: 1,
|
|
169
|
+
createdAt: 1,
|
|
170
|
+
});
|
|
157
171
|
InternalTransferSchema.statics.build = (attrs) => {
|
|
158
172
|
return new InternalTransfer(attrs);
|
|
159
173
|
};
|