Don't create a processor for every thing all the time.

This commit is contained in:
Dan 2022-11-25 15:35:24 -05:00
parent f28b3df552
commit 0e81861444
1 changed files with 8 additions and 7 deletions

View File

@ -327,12 +327,13 @@ class ProcessInstanceService:
def serialize_flat_with_task_data( def serialize_flat_with_task_data(
process_instance: ProcessInstanceModel, process_instance: ProcessInstanceModel,
) -> dict[str, Any]: ) -> dict[str, Any]:
"""NOTE: This is crazy slow. Put the latest task data in the database."""
"""Serialize_flat_with_task_data.""" """Serialize_flat_with_task_data."""
results = {} #results = {}
try: # try:
processor = ProcessInstanceProcessor(process_instance) # processor = ProcessInstanceProcessor(process_instance)
process_instance.data = processor.get_current_data() # process_instance.data = processor.get_current_data()
results = process_instance.serialized_flat # results = process_instance.serialized_flat
except ApiError: # except ApiError:
results = process_instance.serialized results = process_instance.serialized
return results return results