From 8beb63b6a80bb14ff980f0df77ef8428d9e3ac42 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 24 Jul 2018 15:57:18 +0200 Subject: [PATCH] fix: [Queues] module with no subscriber --- bin/Helper.py | 15 +++++++++------ bin/packages/modules.cfg | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/Helper.py b/bin/Helper.py index 289dd956..c0d836e3 100755 --- a/bin/Helper.py +++ b/bin/Helper.py @@ -140,12 +140,15 @@ class Process(object): def populate_set_in(self): # monoproc src = self.modules.get(self.subscriber_name, 'subscribe') - self.pubsub.setup_subscribe(src) - for msg in self.pubsub.subscribe(): - in_set = self.subscriber_name + 'in' - self.r_temp.sadd(in_set, msg) - self.r_temp.hset('queues', self.subscriber_name, - int(self.r_temp.scard(in_set))) + if src != 'Redis': + self.pubsub.setup_subscribe(src) + for msg in self.pubsub.subscribe(): + in_set = self.subscriber_name + 'in' + self.r_temp.sadd(in_set, msg) + self.r_temp.hset('queues', self.subscriber_name, + int(self.r_temp.scard(in_set))) + else: + print('{} has no suscriber'.format(self.subscriber_name)) def get_from_set(self): # multiproc diff --git a/bin/packages/modules.cfg b/bin/packages/modules.cfg index fd78cd07..f50aa263 100644 --- a/bin/packages/modules.cfg +++ b/bin/packages/modules.cfg @@ -130,4 +130,5 @@ subscribe = Redis_Global publish = Redis_Duplicate,Redis_alertHandler,Redis_Tags [submit_paste] +subscribe = Redis publish = Redis_Mixer