From 02135bc1f46fc80d4fa3cdc505136af98bb1e4fd Mon Sep 17 00:00:00 2001 From: ozamiatin Date: Thu, 25 Feb 2016 12:56:27 +0200 Subject: [PATCH] [zmq] Matchmaker redis set instead of list No need to check element before push. Change-Id: Ic4b5ff829d0d94a35aaab1af8ff6991a0b5cebe6 Related-to: I25d623eb4bb0a827daa8a316a0ddcb4a473f8694 --- .../_drivers/zmq_driver/matchmaker/matchmaker_redis.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py b/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py index 1ef48ac19..0d0ce8bca 100644 --- a/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py +++ b/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py @@ -131,8 +131,7 @@ class RedisMatchMaker(base.MatchMakerBase): def register_publisher(self, hostname): host_str = ",".join(hostname) - if host_str not in self._get_hosts_by_key(_PUBLISHERS_KEY): - self._redis.sadd(_PUBLISHERS_KEY, host_str) + self._redis.sadd(_PUBLISHERS_KEY, host_str) def unregister_publisher(self, hostname): host_str = ",".join(hostname)