fix: [Queues] module with no subscriber

pull/231/head
Terrtia 2018-07-24 15:57:18 +02:00
parent 4b8c26dec8
commit 8beb63b6a8
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 10 additions and 6 deletions

View File

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

View File

@ -130,4 +130,5 @@ subscribe = Redis_Global
publish = Redis_Duplicate,Redis_alertHandler,Redis_Tags
[submit_paste]
subscribe = Redis
publish = Redis_Mixer