From 4dac4b71cdeff907591ec23e3bd9be32e09573d1 Mon Sep 17 00:00:00 2001 From: burnout87 Date: Tue, 27 Jun 2023 17:40:32 +0200 Subject: [PATCH] status is logged before the email sending is checked over --- cdci_data_analysis/flask_app/dispatcher_query.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cdci_data_analysis/flask_app/dispatcher_query.py b/cdci_data_analysis/flask_app/dispatcher_query.py index 083f0f328..21b68a00e 100644 --- a/cdci_data_analysis/flask_app/dispatcher_query.py +++ b/cdci_data_analysis/flask_app/dispatcher_query.py @@ -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() @@ -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) except email_helper.MultipleDoneEmail as e: job.write_dataserver_status(status_dictionary_value=status, @@ -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, @@ -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')