Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status is logged before the email sending is checked over #549

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cdci_data_analysis/flask_app/dispatcher_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,9 @@ def run_call_back(self, status_kw_name='action') -> typing.Tuple[str, typing.Uni

logger.warn('-----> set status to %s', status)

job.write_dataserver_status(status_dictionary_value=status,
full_dict=self.par_dic)

try:
# TODO for a future implementation
# self.validate_job_id()
Expand Down Expand Up @@ -1077,8 +1080,8 @@ def run_call_back(self, status_kw_name='action') -> typing.Tuple[str, typing.Uni
full_dict=self.par_dic,
email_status='email sent',
email_status_details=status_details)
else:
job.write_dataserver_status(status_dictionary_value=status, full_dict=self.par_dic)
# else:
# job.write_dataserver_status(status_dictionary_value=status, full_dict=self.par_dic)
Comment on lines +1083 to +1084

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.

except email_helper.MultipleDoneEmail as e:
job.write_dataserver_status(status_dictionary_value=status,
Expand Down Expand Up @@ -1821,6 +1824,8 @@ def run_query(self, off_line=False, disp_conf=None):
query_new_status = 'submitted'
job.set_submitted()

job.write_dataserver_status()

if email_helper.is_email_to_send_run_query(self.logger,
query_new_status,
self.time_request,
Expand Down Expand Up @@ -1854,7 +1859,7 @@ def run_query(self, off_line=False, disp_conf=None):
api_code=email_api_code,
scratch_dir=self.scratch_dir)

# store an additional information about the sent email
# store additional information about the sent email
query_out.set_status_field('email_status', 'email sent')
except email_helper.EMailNotSent as e:
query_out.set_status_field('email_status', 'sending email failed')
Expand Down