changeset 2407:cf9b276f4a08

core (disco): do not cache disco items when node is set
author Goffi <goffi@goffi.org>
date Tue, 31 Oct 2017 23:11:58 +0100
parents 1e5b2c35964e
children a870daeab15e
files src/memory/disco.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/memory/disco.py	Tue Oct 31 23:11:13 2017 +0100
+++ b/src/memory/disco.py	Tue Oct 31 23:11:58 2017 +0100
@@ -198,9 +198,12 @@
         @param use_cache(bool): if True, use cached data if available
         @return: a Deferred which fire disco.DiscoItems
         """
+        server_jid = jid.JID(client.jid.host)
         if jid_ is None:
-            jid_ = jid.JID(client.jid.host)
-            # we cache items only for our own server
+            jid_ = server_jid
+
+        if jid_ == server_jid and not node:
+            # we cache items only for our own server and if node is not set
             try:
                 items = self.host.memory.getEntityData(jid_, ["DISCO_ITEMS"], client.profile)["DISCO_ITEMS"]
                 log.debug(u"[%s] disco items are in cache" % jid_.full())