mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
fix: [Mail module] debug signal timeout
This commit is contained in:
parent
8f31b9b90c
commit
f9ce4fa280
1 changed files with 5 additions and 3 deletions
|
@ -33,10 +33,10 @@ class TimeoutException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def timeout_handler(signum, frame):
|
def timeout_handler(signum, frame):
|
||||||
raise TimeoutException
|
raise TimeoutException()
|
||||||
|
|
||||||
signal.signal(signal.SIGALRM, timeout_handler)
|
signal.signal(signal.SIGALRM, timeout_handler)
|
||||||
max_execution_time = 30
|
max_execution_time = 20
|
||||||
## -- ##
|
## -- ##
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages'))
|
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages'))
|
||||||
|
@ -156,8 +156,10 @@ if __name__ == "__main__":
|
||||||
p.incr_module_timeout_statistic()
|
p.incr_module_timeout_statistic()
|
||||||
err_mess = "Mails: processing timeout: {}".format(item_id)
|
err_mess = "Mails: processing timeout: {}".format(item_id)
|
||||||
print(err_mess)
|
print(err_mess)
|
||||||
|
time.sleep(30)
|
||||||
publisher.info(err_mess)
|
publisher.info(err_mess)
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
signal.alarm(0)
|
signal.alarm(0)
|
||||||
|
|
||||||
# filtering duplicate
|
# filtering duplicate
|
||||||
|
|
Loading…
Reference in a new issue