@okf/ootils 1.4.4 → 1.4.6
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/dist/node.js +27 -5
- package/dist/node.mjs +27 -5
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -348,6 +348,7 @@ var require_MongoConnector = __commonJS({
|
|
|
348
348
|
var MongoConnector3 = class _MongoConnector {
|
|
349
349
|
constructor(options) {
|
|
350
350
|
__publicField(this, "initiateConnectionEventListeners", (CLUSTER_NAME) => {
|
|
351
|
+
console.log("in initiate connection listeners");
|
|
351
352
|
this.clusterConnections[CLUSTER_NAME].on("open", () => {
|
|
352
353
|
console.log(`\u2705 Mongoose connection open to ${CLUSTER_NAME}`);
|
|
353
354
|
});
|
|
@@ -430,12 +431,16 @@ var require_MongoConnector = __commonJS({
|
|
|
430
431
|
`Missing CLUSTER_NAME or DB_URI for environment: ${connectToEnv}`
|
|
431
432
|
);
|
|
432
433
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
this.mongoOptions
|
|
436
|
-
).asPromise();
|
|
437
|
-
console.log(`Connected to MongoDB: ${CLUSTER_NAME}`);
|
|
434
|
+
const connection = mongoose5.createConnection(DB_URI, this.mongoOptions);
|
|
435
|
+
this.clusterConnections[CLUSTER_NAME] = connection;
|
|
438
436
|
this.initiateConnectionEventListeners(CLUSTER_NAME);
|
|
437
|
+
await new Promise((resolve, reject) => {
|
|
438
|
+
connection.once("open", () => {
|
|
439
|
+
console.log(`Connected to MongoDB: ${CLUSTER_NAME}`);
|
|
440
|
+
resolve();
|
|
441
|
+
});
|
|
442
|
+
connection.once("error", reject);
|
|
443
|
+
});
|
|
439
444
|
})
|
|
440
445
|
);
|
|
441
446
|
return this.clusterConnections;
|
|
@@ -985,6 +990,23 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
985
990
|
// ...60 seconds (higher throughput for chunking)
|
|
986
991
|
}
|
|
987
992
|
}
|
|
993
|
+
},
|
|
994
|
+
AI_CATEGORIZE_QUEUE: {
|
|
995
|
+
id: "ai-categorize-queue",
|
|
996
|
+
queueConfig: {
|
|
997
|
+
defaultJobOptions: {
|
|
998
|
+
attempts: 3,
|
|
999
|
+
backoff: {
|
|
1000
|
+
type: "exponential",
|
|
1001
|
+
delay: 2e3
|
|
1002
|
+
},
|
|
1003
|
+
removeOnComplete: 50,
|
|
1004
|
+
removeOnFail: 100
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
workerConfig: {
|
|
1008
|
+
concurrency: 1
|
|
1009
|
+
}
|
|
988
1010
|
}
|
|
989
1011
|
};
|
|
990
1012
|
}
|
package/dist/node.mjs
CHANGED
|
@@ -353,6 +353,7 @@ var require_MongoConnector = __commonJS({
|
|
|
353
353
|
var MongoConnector3 = class _MongoConnector {
|
|
354
354
|
constructor(options) {
|
|
355
355
|
__publicField(this, "initiateConnectionEventListeners", (CLUSTER_NAME) => {
|
|
356
|
+
console.log("in initiate connection listeners");
|
|
356
357
|
this.clusterConnections[CLUSTER_NAME].on("open", () => {
|
|
357
358
|
console.log(`\u2705 Mongoose connection open to ${CLUSTER_NAME}`);
|
|
358
359
|
});
|
|
@@ -435,12 +436,16 @@ var require_MongoConnector = __commonJS({
|
|
|
435
436
|
`Missing CLUSTER_NAME or DB_URI for environment: ${connectToEnv}`
|
|
436
437
|
);
|
|
437
438
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
this.mongoOptions
|
|
441
|
-
).asPromise();
|
|
442
|
-
console.log(`Connected to MongoDB: ${CLUSTER_NAME}`);
|
|
439
|
+
const connection = mongoose5.createConnection(DB_URI, this.mongoOptions);
|
|
440
|
+
this.clusterConnections[CLUSTER_NAME] = connection;
|
|
443
441
|
this.initiateConnectionEventListeners(CLUSTER_NAME);
|
|
442
|
+
await new Promise((resolve, reject) => {
|
|
443
|
+
connection.once("open", () => {
|
|
444
|
+
console.log(`Connected to MongoDB: ${CLUSTER_NAME}`);
|
|
445
|
+
resolve();
|
|
446
|
+
});
|
|
447
|
+
connection.once("error", reject);
|
|
448
|
+
});
|
|
444
449
|
})
|
|
445
450
|
);
|
|
446
451
|
return this.clusterConnections;
|
|
@@ -990,6 +995,23 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
990
995
|
// ...60 seconds (higher throughput for chunking)
|
|
991
996
|
}
|
|
992
997
|
}
|
|
998
|
+
},
|
|
999
|
+
AI_CATEGORIZE_QUEUE: {
|
|
1000
|
+
id: "ai-categorize-queue",
|
|
1001
|
+
queueConfig: {
|
|
1002
|
+
defaultJobOptions: {
|
|
1003
|
+
attempts: 3,
|
|
1004
|
+
backoff: {
|
|
1005
|
+
type: "exponential",
|
|
1006
|
+
delay: 2e3
|
|
1007
|
+
},
|
|
1008
|
+
removeOnComplete: 50,
|
|
1009
|
+
removeOnFail: 100
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
workerConfig: {
|
|
1013
|
+
concurrency: 1
|
|
1014
|
+
}
|
|
993
1015
|
}
|
|
994
1016
|
};
|
|
995
1017
|
}
|