@resolveio/server-lib 5.0.0-rc-1 → 5.0.0-rc-3
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.
|
@@ -51,6 +51,7 @@ var method_responses_1 = require("../publications/method-responses");
|
|
|
51
51
|
var support_tickets_1 = require("../publications/support-tickets");
|
|
52
52
|
var index_1 = require("../index");
|
|
53
53
|
var notifications_1 = require("../publications/notifications");
|
|
54
|
+
var common_1 = require("../util/common");
|
|
54
55
|
var billing_logged_in_users_collection_1 = require("../collections/billing-logged-in-users.collection");
|
|
55
56
|
var moment = require("moment");
|
|
56
57
|
var billing_logged_in_users_1 = require("../publications/billing-logged-in-users");
|
|
@@ -711,9 +712,6 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
711
712
|
var _this = this;
|
|
712
713
|
return __generator(this, function (_c) {
|
|
713
714
|
that = this;
|
|
714
|
-
if (subscription.publication !== 'superadminAPM' && subscription.publication !== 'loggedInUsers') {
|
|
715
|
-
that._mainServer.getMethodManager().callMethodInternal('insertSubscriptionLog', type, subscription.publication, collection, JSON.stringify(subscription.subscriptionData));
|
|
716
|
-
}
|
|
717
715
|
if (!that._publications[subscription.publication].ws_specific) { // Same pub for all users
|
|
718
716
|
if (this._subCache.some(function (a) { return a.publication === subscription.publication && JSON.stringify(a.subscriptionData) === JSON.stringify(subscription.subscriptionData); })) {
|
|
719
717
|
serverRes = {
|
|
@@ -724,8 +722,14 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
724
722
|
this.sendWS(ws, serverRes);
|
|
725
723
|
}
|
|
726
724
|
else {
|
|
725
|
+
if (subscription.publication !== 'superadminAPM' && subscription.publication !== 'loggedInUsers') {
|
|
726
|
+
that._mainServer.getMethodManager().callMethodInternal('insertSubscriptionLog', type, subscription.publication, collection, JSON.stringify(subscription.subscriptionData));
|
|
727
|
+
}
|
|
727
728
|
(_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
|
|
728
|
-
|
|
729
|
+
console.log(common_1.getBinarySize(JSON.stringify(_this._subCache)));
|
|
730
|
+
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) < 500000000) {
|
|
731
|
+
_this._subCache.push({ publication: subscription.publication, subscriptionData: subscription.subscriptionData, res: res });
|
|
732
|
+
}
|
|
729
733
|
var serverRes = {
|
|
730
734
|
messageId: messageId,
|
|
731
735
|
hasError: false,
|
|
@@ -772,9 +776,6 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
772
776
|
var _this = this;
|
|
773
777
|
return __generator(this, function (_b) {
|
|
774
778
|
that = this;
|
|
775
|
-
if (subscription.publication !== 'superadminAPM' && subscription.publication !== 'loggedInUsers') {
|
|
776
|
-
that._mainServer.getMethodManager().callMethodInternal('insertSubscriptionLog', type, subscription.publication, collection, JSON.stringify(subscription.subscriptionData));
|
|
777
|
-
}
|
|
778
779
|
if (this._subCache.some(function (a) { return a.publication === subscription.publication && JSON.stringify(a.subscriptionData) === JSON.stringify(subscription.subscriptionData); })) {
|
|
779
780
|
subscription.clients.forEach(function (client) {
|
|
780
781
|
that._wss.clients.forEach(function (ws) {
|
|
@@ -790,8 +791,14 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
790
791
|
});
|
|
791
792
|
}
|
|
792
793
|
else {
|
|
794
|
+
if (subscription.publication !== 'superadminAPM' && subscription.publication !== 'loggedInUsers') {
|
|
795
|
+
that._mainServer.getMethodManager().callMethodInternal('insertSubscriptionLog', type, subscription.publication, collection, JSON.stringify(subscription.subscriptionData));
|
|
796
|
+
}
|
|
793
797
|
(_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
|
|
794
|
-
|
|
798
|
+
console.log(common_1.getBinarySize(JSON.stringify(_this._subCache)));
|
|
799
|
+
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) < 500000000) {
|
|
800
|
+
_this._subCache.push({ publication: subscription.publication, subscriptionData: subscription.subscriptionData, res: res });
|
|
801
|
+
}
|
|
795
802
|
subscription.clients.forEach(function (client) {
|
|
796
803
|
that._wss.clients.forEach(function (ws) {
|
|
797
804
|
if (ws['id_socket'] === client.id_socket) {
|