@resolveio/server-lib 5.0.0-rc-3 → 5.0.0
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.
|
@@ -727,9 +727,10 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
727
727
|
}
|
|
728
728
|
(_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
|
|
729
729
|
console.log(common_1.getBinarySize(JSON.stringify(_this._subCache)));
|
|
730
|
-
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) <
|
|
731
|
-
_this._subCache.
|
|
730
|
+
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) < 750000000) {
|
|
731
|
+
_this._subCache.splice(0, 1);
|
|
732
732
|
}
|
|
733
|
+
_this._subCache.push({ publication: subscription.publication, subscriptionData: subscription.subscriptionData, res: res });
|
|
733
734
|
var serverRes = {
|
|
734
735
|
messageId: messageId,
|
|
735
736
|
hasError: false,
|
|
@@ -796,9 +797,10 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
796
797
|
}
|
|
797
798
|
(_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
|
|
798
799
|
console.log(common_1.getBinarySize(JSON.stringify(_this._subCache)));
|
|
799
|
-
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) <
|
|
800
|
-
_this._subCache.
|
|
800
|
+
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) < 750000000) {
|
|
801
|
+
_this._subCache.splice(0, 1);
|
|
801
802
|
}
|
|
803
|
+
_this._subCache.push({ publication: subscription.publication, subscriptionData: subscription.subscriptionData, res: res });
|
|
802
804
|
subscription.clients.forEach(function (client) {
|
|
803
805
|
that._wss.clients.forEach(function (ws) {
|
|
804
806
|
if (ws['id_socket'] === client.id_socket) {
|