From 0e818614442c4370f4a491d5a7429f9e30f1e63c Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 25 Nov 2022 15:35:24 -0500 Subject: [PATCH] Don't create a processor for every thing all the time. --- .../services/process_instance_service.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py index afca3b5f1..24048afb8 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py @@ -327,12 +327,13 @@ class ProcessInstanceService: def serialize_flat_with_task_data( process_instance: ProcessInstanceModel, ) -> dict[str, Any]: + """NOTE: This is crazy slow. Put the latest task data in the database.""" """Serialize_flat_with_task_data.""" - results = {} - try: - processor = ProcessInstanceProcessor(process_instance) - process_instance.data = processor.get_current_data() - results = process_instance.serialized_flat - except ApiError: - results = process_instance.serialized + #results = {} + # try: + # processor = ProcessInstanceProcessor(process_instance) + # process_instance.data = processor.get_current_data() + # results = process_instance.serialized_flat + # except ApiError: + results = process_instance.serialized return results