@resolveio/server-lib 4.3.3 → 4.3.4
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/managers/subscription.manager.js +22 -13
- package/package.json +1 -1
|
@@ -409,11 +409,13 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
409
409
|
else if (collection === 'support-tickets') {
|
|
410
410
|
_this._mainServer.getMethodManager().callMethodInternal('sendSupportTicketEmail', doc.o._id);
|
|
411
411
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
412
|
+
if (!collection.endsWith('.versions')) {
|
|
413
|
+
_this._oplogQueue.push({
|
|
414
|
+
type: 'insert',
|
|
415
|
+
collection: collection,
|
|
416
|
+
doc: doc.o
|
|
417
|
+
});
|
|
418
|
+
}
|
|
417
419
|
});
|
|
418
420
|
oplog.on('update', function (doc) {
|
|
419
421
|
var nsArray = doc.ns.split('.');
|
|
@@ -425,11 +427,13 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
425
427
|
if (collection === 'cron-jobs') {
|
|
426
428
|
_this._mainServer.getCronManager().checkCronJobsForUpdates();
|
|
427
429
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
430
|
+
if (!collection.endsWith('.versions')) {
|
|
431
|
+
_this._oplogQueue.push({
|
|
432
|
+
type: 'update',
|
|
433
|
+
collection: collection,
|
|
434
|
+
doc: doc.o
|
|
435
|
+
});
|
|
436
|
+
}
|
|
433
437
|
});
|
|
434
438
|
oplog.on('delete', function (doc) {
|
|
435
439
|
var nsArray = doc.ns.split('.');
|
|
@@ -515,7 +519,7 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
515
519
|
this._oplogQueue = [];
|
|
516
520
|
uniqueOplog_1 = [];
|
|
517
521
|
needIds_1 = {};
|
|
518
|
-
console.log('----------------OPLOG QUEUE START BEFORE DATA--------------------', new Date(), oplogQueue.length);
|
|
522
|
+
// console.log('----------------OPLOG QUEUE START BEFORE DATA--------------------', new Date(), oplogQueue.length);
|
|
519
523
|
oplogQueue.forEach(function (oplog) {
|
|
520
524
|
if (!uniqueOplog_1.filter(function (a) { return JSON.stringify(a) === JSON.stringify(oplog); }).length) {
|
|
521
525
|
uniqueOplog_1.push(oplog);
|
|
@@ -550,7 +554,12 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
550
554
|
case 1:
|
|
551
555
|
docs = _a.sent();
|
|
552
556
|
needIds_1[collection].forEach(function (id_doc) {
|
|
553
|
-
uniqueOplog_1.filter(function (a) { return a.doc
|
|
557
|
+
if (uniqueOplog_1.filter(function (a) { return a.doc && a.doc._id === id_doc; })[0]) {
|
|
558
|
+
uniqueOplog_1.filter(function (a) { return a.doc && a.doc._id === id_doc; })[0].doc = docs.filter(function (a) { return a._id === id_doc; })[0];
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
console.log('PROBLEMAAAAAAAA');
|
|
562
|
+
}
|
|
554
563
|
});
|
|
555
564
|
return [2 /*return*/];
|
|
556
565
|
}
|
|
@@ -568,7 +577,7 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
568
577
|
i++;
|
|
569
578
|
return [3 /*break*/, 1];
|
|
570
579
|
case 4:
|
|
571
|
-
console.log('----------------OPLOG QUEUE END--------------------', new Date(),
|
|
580
|
+
// console.log('----------------OPLOG QUEUE END--------------------', new Date(), uniqueOplog.length);
|
|
572
581
|
uniqueOplog_1.forEach(function (oplog) {
|
|
573
582
|
// console.log('OPLOG QUEUE END - Oplog', oplog);
|
|
574
583
|
_this.checkPubsForChanges(oplog.collection, oplog.doc, oplog.type);
|