Print out some additional debugging information in the email script so we can tell what is happening and where.

This commit is contained in:
Dan 2021-07-22 16:02:08 -04:00
parent 61504664d4
commit 7f5c7417d8
2 changed files with 22 additions and 11 deletions

View File

@ -55,7 +55,7 @@ def process_waiting_tasks():
with app.app_context():
WorkflowService.do_waiting()
scheduler.add_job(process_waiting_tasks,'interval',minutes=5)
scheduler.add_job(process_waiting_tasks,'interval',minutes=1)
scheduler.start()

View File

@ -1,3 +1,6 @@
import sys
import traceback
from crc import app
from crc.api.common import ApiError
from crc.scripts.script import Script
@ -44,6 +47,7 @@ email (subject="My Subject", recipients=["dhf8r@virginia.edu", pi.email], cc='as
if recipients:
message = task.task_spec.documentation
data = task.data
try:
content, content_html = EmailService().get_rendered_content(message, data)
EmailService.add_email(
subject=subject,
@ -54,6 +58,13 @@ email (subject="My Subject", recipients=["dhf8r@virginia.edu", pi.email], cc='as
cc=cc,
study_id=study_id
)
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
print("*** format_exception:")
# exc_type below is ignored on 3.5 and later
print(repr(traceback.format_exception(exc_type, exc_value,
exc_traceback)))
raise e
def get_email_addresses(self, users, study_id):
emails = []