From a626b8b888e4746ce44e372a61af8f0264f8d70a Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 10 Jul 2022 15:16:15 +0200 Subject: [PATCH] plugin pubsub cache: resync in `synchronise` when node's `sync_state` is not set: synchronisation used to be skipped when the node was existing and `resync` was not set, however the case happens when a node is subscribed but not synchronised, thus this patch update the behaviour to be sure to have the node synchronised. rel 369 --- sat/plugins/plugin_pubsub_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sat/plugins/plugin_pubsub_cache.py b/sat/plugins/plugin_pubsub_cache.py index 1c5a6bd5..359567db 100644 --- a/sat/plugins/plugin_pubsub_cache.py +++ b/sat/plugins/plugin_pubsub_cache.py @@ -564,7 +564,7 @@ class PubsubCache: f"Unexpected Pubsub event element: {xml_tools.pFmtElt(elt)}" ) if items: - log.debug("caching new items received from {node}") + log.debug(f"[{client.profile}] caching new items received from {node}") await self.cacheItems( client, node, items ) @@ -736,7 +736,7 @@ class PubsubCache: analyser=analyse.get("name"), type_=analyse.get("type"), ) - elif not resync: + elif not resync and pubsub_node.sync_state is not None: # the node exists, nothing to do return