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
This commit is contained in:
Goffi 2022-07-10 15:16:15 +02:00
commit a626b8b888

View file

@ -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