Implementacion mas completa de email y api para ingresar datos

This commit is contained in:
2020-11-16 23:33:49 -03:00
parent 1b57d705bb
commit 2d157f6989
14 changed files with 369 additions and 112 deletions

View File

@ -6,6 +6,9 @@ import time
class Email(Thread):
"""
Email module supervisor thread
"""
def __init__(self, configs, params, setup):
super(Email, self).__init__()
@ -17,6 +20,7 @@ class Email(Thread):
self.worker_status = []
self.add_event('stop')
self.add_event('log_stop')
self.setup(setup)
@ -27,8 +31,8 @@ class Email(Thread):
self.add_queue(q)
for e in data['events']:
self.add_event(e)
for l in data['locks']:
self.add_lock(l)
for lo in data['locks']:
self.add_lock(lo)
def register_worker(self, module, name):
if module not in self.registry:
@ -99,4 +103,6 @@ class Email(Thread):
if not self.check_workers():
break
time.sleep(self.configs.get('supervisor.wait'))
self.params['logging'].log('Waiting for workers', type(self))
self.params['events']['log_stop'].set()
self.join_workers()