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 75c1674eed
commit d4f85ec182
1 changed files with 8 additions and 7 deletions

View File

@ -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