mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [Queues] module with no subscriber
This commit is contained in:
parent
4b8c26dec8
commit
8beb63b6a8
2 changed files with 10 additions and 6 deletions
|
@ -140,12 +140,15 @@ class Process(object):
|
||||||
def populate_set_in(self):
|
def populate_set_in(self):
|
||||||
# monoproc
|
# monoproc
|
||||||
src = self.modules.get(self.subscriber_name, 'subscribe')
|
src = self.modules.get(self.subscriber_name, 'subscribe')
|
||||||
self.pubsub.setup_subscribe(src)
|
if src != 'Redis':
|
||||||
for msg in self.pubsub.subscribe():
|
self.pubsub.setup_subscribe(src)
|
||||||
in_set = self.subscriber_name + 'in'
|
for msg in self.pubsub.subscribe():
|
||||||
self.r_temp.sadd(in_set, msg)
|
in_set = self.subscriber_name + 'in'
|
||||||
self.r_temp.hset('queues', self.subscriber_name,
|
self.r_temp.sadd(in_set, msg)
|
||||||
int(self.r_temp.scard(in_set)))
|
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):
|
def get_from_set(self):
|
||||||
# multiproc
|
# multiproc
|
||||||
|
|
|
@ -130,4 +130,5 @@ subscribe = Redis_Global
|
||||||
publish = Redis_Duplicate,Redis_alertHandler,Redis_Tags
|
publish = Redis_Duplicate,Redis_alertHandler,Redis_Tags
|
||||||
|
|
||||||
[submit_paste]
|
[submit_paste]
|
||||||
|
subscribe = Redis
|
||||||
publish = Redis_Mixer
|
publish = Redis_Mixer
|
||||||
|
|
Loading…
Reference in a new issue