fix: Fixes initializing cached keys.

This commit is contained in:
damencho
2024-02-16 11:34:05 -06:00
committed by Дамян Минков
parent a4d53f271f
commit 990d21038e
2 changed files with 3 additions and 2 deletions

View File

@@ -125,10 +125,10 @@ local function throttle_session(session)
if not session.jitsi_throttle then
if (session.conn and session.conn.setlimit) then
-- TODO: we don't have a mechanism to unthrottle a session in this case.
module:log("info", "Enabling throttle (%s bytes/s) via setlimit, session=%s, ip=%s.", config.session_rate, session, session.ip);
module:log("info", "Enabling throttle (%s bytes/s) via setlimit, session=%s, ip=%s.", config.session_rate, session.id, session.ip);
session.conn:setlimit(config.session_rate);
else
module:log("info", "Enabling throttle (%s bytes/s) via filter, session=%s, ip=%s.", config.session_rate, session, session.ip);
module:log("info", "Enabling throttle (%s bytes/s) via filter, session=%s, ip=%s.", config.session_rate, session.id, session.ip);
session.jitsi_throttle = new_throttle(config.session_rate, 2);
filters.add_filter(session, "bytes/in", limit_bytes_in, 1000);
-- throttle.start used for stop throttling after the timeout

View File

@@ -120,6 +120,7 @@ function Util.new(module)
end
if self.cacheKeysUrl then
self.cachedKeys = {};
local update_keys_cache;
update_keys_cache = async.runner(function (name)
content, code, cache_for = http_get_with_retry(self.cacheKeysUrl, nr_retries);