@data-fair/lib-node 2.9.0 → 2.9.1

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/events-queue.js CHANGED
@@ -15,7 +15,7 @@ export class EventsQueue {
15
15
  }
16
16
  start = async (options) => {
17
17
  if (this._options)
18
- throw new Error('events queue was already initialized');
18
+ return; // already initialized
19
19
  this._options = options;
20
20
  this.loop();
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-node",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Small nodejs related utility functions for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [
package/ws-emitter.js CHANGED
@@ -8,6 +8,8 @@ export const initMessagesCollection = async (db) => {
8
8
  };
9
9
  let messagesCollection;
10
10
  export const init = async (db) => {
11
+ if (messagesCollection)
12
+ return; // already initialized
11
13
  messagesCollection = await initMessagesCollection(db);
12
14
  await messagesCollection.insertOne({ type: 'init' });
13
15
  };