wingbot-mongodb 2.21.6 → 2.21.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot-mongodb",
3
- "version": "2.21.6",
3
+ "version": "2.21.7",
4
4
  "description": "MongoDB storage for wingbot.ai",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
@@ -100,6 +100,17 @@ class NotificationsStorage {
100
100
  * @type {Map<string,Promise<mongodb.Collection>>}
101
101
  */
102
102
  this._collections = new Map();
103
+
104
+ if (isCosmo && !process.argv.some((a) => a.endsWith('mocha'))) {
105
+ process.nextTick(() => {
106
+ Promise.all([
107
+ this._getCollection(this.taksCollection),
108
+ this._getCollection(this.campaignsCollection),
109
+ this._getCollection(this.subscribtionsCollection)
110
+ ])
111
+ .catch((e) => log.error('DB.<NotificationsStorage> index pre-heat FAILED', e));
112
+ });
113
+ }
103
114
  }
104
115
 
105
116
  async _getOrCreateCollection (name) {