From 0356b996bacf53854429c0fa01e77a43abed10fd Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:34:39 +0700 Subject: [PATCH] fix: wss requestor incase mysql cache is used (#319) --- lib/middleware.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/middleware.js b/lib/middleware.js index f37350e6..2c3cb4ea 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -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 {