Avoid that threads of the same type can be executed twice or thrice etc.

This commit is contained in:
Stephan Porada
2020-06-08 10:23:32 +02:00
parent 9e88330433
commit b56a8362ff
9 changed files with 81 additions and 104 deletions

View File

@ -24,4 +24,4 @@ class Notification(EmailMessage):
def set_addresses(self, sender, recipient):
self['From'] = sender
self['to'] = recipient
self['to'] = recipient

View File

@ -8,10 +8,10 @@ class NotificationService(object):
def __init__(self, execute_flag):
super(NotificationService, self).__init__()
self.execute_flag = execute_flag # If True mails are sent normaly
# If False mails are not sent. Used to avoid sending mails for jobs that
# have been completed a long time ago. Use this if you implement notify
# into an already existing nopaque instance. Change it to True after the
# daemon has run one time with the flag set to False
# If False mails are not sent. Used to avoid sending mails for jobs
# that have been completed a long time ago. Use this if you implement
# notify into an already existing nopaque instance. Change it to True
# after the daemon has run one time with the flag set to False
self.not_sent = {} # Holds due to an error unsent email notifications
self.mail_limit_exceeded = False # Bool to show if the mail server
# stoped sending mails due to exceeding its sending limit
@ -38,4 +38,4 @@ class NotificationService(object):
return
def quit(self):
self.smtp_server.quit()
self.smtp_server.quit()