fix: wss requestor incase mysql cache is used (#319)

This commit is contained in:
Hoan Luu Huu
2023-04-18 17:34:39 +07:00
committed by GitHub
parent 271587617e
commit 0356b996ba

View File

@@ -248,8 +248,9 @@ module.exports = function(srf, logger) {
const app2 = JAMBONES_MYSQL_REFRESH_TTL ? JSON.parse(JSON.stringify(app)) : app;
if ('WS' === app.call_hook?.method ||
app.call_hook?.url.startsWith('ws://') || app.call_hook?.url.startsWith('wss://')) {
app2.requestor = new WsRequestor(logger, account_sid, app.call_hook, accountInfo.account.webhook_secret) ;
app2.notifier = app.requestor;
const requestor = new WsRequestor(logger, account_sid, app.call_hook, accountInfo.account.webhook_secret) ;
app2.requestor = requestor;
app2.notifier = requestor;
app2.call_hook.method = 'WS';
}
else {