tests (unit): Fix tests.
This commit is contained in:
parent
3a2a5f787d
commit
e68278a1ac
1 changed files with 88 additions and 102 deletions
|
|
@ -66,17 +66,13 @@ class PubsubCache:
|
|||
|
||||
def __init__(self, host):
|
||||
log.info(_("PubSub Cache initialization"))
|
||||
strategy = G.config.common.pubsub_cache_strategy
|
||||
if strategy == "no_cache":
|
||||
if (strategy := G.config.common.pubsub_cache_strategy) == "no_cache":
|
||||
log.info(
|
||||
_(
|
||||
"Pubsub cache won't be used due to pubsub_cache_strategy={value} "
|
||||
"setting."
|
||||
).format(value=repr(strategy))
|
||||
)
|
||||
self.use_cache = False
|
||||
else:
|
||||
self.use_cache = True
|
||||
self.host = host
|
||||
self._p = host.plugins["XEP-0060"]
|
||||
self.analysers = {}
|
||||
|
|
@ -592,7 +588,10 @@ class PubsubCache:
|
|||
rsm_request: Optional[rsm.RSMRequest],
|
||||
extra: dict,
|
||||
) -> Tuple[bool, Optional[Tuple[List[dict], dict]]]:
|
||||
if not self.use_cache:
|
||||
# Check if cache is disabled by configuration (checking at runtime to handle
|
||||
# dynamic config changes)
|
||||
from pudb import set_trace; set_trace()
|
||||
if G.config.common.pubsub_cache_strategy == "no_cache":
|
||||
log.debug("cache disabled in settings")
|
||||
return True, None
|
||||
if extra.get(C.KEY_USE_CACHE) == False:
|
||||
|
|
|
|||
Loading…
Reference in a new issue