changeset 3831:604b6acaee22

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
author Goffi <goffi@goffi.org>
date Sun, 10 Jul 2022 15:16:15 +0200
parents 68a11b95a7d3
children 201a22bfbb74
files sat/plugins/plugin_pubsub_cache.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_pubsub_cache.py	Sun Jul 10 15:16:05 2022 +0200
+++ b/sat/plugins/plugin_pubsub_cache.py	Sun Jul 10 15:16:15 2022 +0200
@@ -564,7 +564,7 @@
                         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 @@
                 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