Save logs in finally (#134)
This commit is contained in:
parent
fc67409408
commit
ddcecb21c4
|
@ -1582,17 +1582,17 @@ class ProcessInstanceProcessor:
|
||||||
|
|
||||||
self.process_bpmn_messages()
|
self.process_bpmn_messages()
|
||||||
self.queue_waiting_receive_messages()
|
self.queue_waiting_receive_messages()
|
||||||
|
except SpiffWorkflowException as swe:
|
||||||
|
raise ApiError.from_workflow_exception("task_error", str(swe), swe) from swe
|
||||||
|
|
||||||
|
finally:
|
||||||
db.session.bulk_insert_mappings(SpiffStepDetailsModel, step_details)
|
db.session.bulk_insert_mappings(SpiffStepDetailsModel, step_details)
|
||||||
spiff_logger = logging.getLogger("spiff")
|
spiff_logger = logging.getLogger("spiff")
|
||||||
for handler in spiff_logger.handlers:
|
for handler in spiff_logger.handlers:
|
||||||
if hasattr(handler, "bulk_insert_logs"):
|
if hasattr(handler, "bulk_insert_logs"):
|
||||||
handler.bulk_insert_logs() # type: ignore
|
handler.bulk_insert_logs() # type: ignore
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
except SpiffWorkflowException as swe:
|
|
||||||
raise ApiError.from_workflow_exception("task_error", str(swe), swe) from swe
|
|
||||||
|
|
||||||
finally:
|
|
||||||
if save:
|
if save:
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue