Skip to content
Snippets Groups Projects
Commit 027b3512 authored by Jan Hartig's avatar Jan Hartig
Browse files

Fix error mails

parent f2e09b01
No related branches found
No related tags found
1 merge request!8Fix error mails
......@@ -92,16 +92,19 @@ def main(end):
msg = EmailMessage()
msg["Subject"] = "Subtitle Service Error Report"
msg["From"] = config["MAIL"]["FROM"]
msg["To"] = config["MONITORING"]["MAIL"]
msg["To"] = config["MONITORING_MAIL"]
job_uuids = []
for job in error_jobs:
job_uuids.append(Path(job).name)
msg.set_content(
"The following jobs currently have errors:\n{}".format("\n - ".join(job_uuids))
"The following jobs currently have errors:\n\n - {}".format("\n - ".join(job_uuids))
)
s.send_message(msg)
sent += 1
except KeyError:
pass
......@@ -122,7 +125,7 @@ def main(end):
pass
print(
"[MAILSERVICE] Sent {} mails. Sleeping for {} seconds.".format(
"[MAILSERVICE] Sent {} mail(s). Sleeping for {} seconds.".format(
sent, config["MAILSERVICE_INTERVAL"]
)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment