More push messaging fixes.

This commit is contained in:
Ylian Saint-Hilaire 2021-02-04 00:03:51 -08:00
parent 87896b5f0d
commit d717135148
1 changed files with 3 additions and 1 deletions

View File

@ -242,11 +242,13 @@ module.exports.CreateFirebaseRelay = function (parent, url, key) {
// If the web socket is open, send now
if (obj.wsopen == true) {
try { obj.wsclient.send(JSON.stringify({ pmt: node.pmt, payload: payload, options: options })); } catch (ex) { func(0, 'error'); return; }
try { obj.wsclient.send(JSON.stringify({ pmt: node.pmt, payload: payload, options: options })); } catch (ex) { func(0, 'error'); obj.stats.sendError++; return; }
obj.stats.sent++;
func(1);
} else {
// TODO: Buffer the push messages until TTL.
func(0, 'error');
obj.stats.sendError++;
}
}
obj.connectWebSocket();