do not save events to db when running data migrations w/ burnettk
This commit is contained in:
parent
abf87a5aa3
commit
4d7347c131
|
@ -29,7 +29,7 @@ class Version2(DataMigrationBase):
|
|||
for spiff_task in spiff_tasks:
|
||||
cls.update_spiff_task_parents(spiff_task, task_service)
|
||||
|
||||
task_service.save_objects_to_database()
|
||||
task_service.save_objects_to_database(save_process_instance_events=False)
|
||||
except Exception as ex:
|
||||
current_app.logger.warning(
|
||||
f"Failed to migrate process_instance '{process_instance.id}'. The error was {str(ex)}"
|
||||
|
|
|
@ -117,9 +117,10 @@ class TaskService:
|
|||
self.json_data_dicts: dict[str, JsonDataDict] = {}
|
||||
self.process_instance_events: dict[str, ProcessInstanceEventModel] = {}
|
||||
|
||||
def save_objects_to_database(self) -> None:
|
||||
def save_objects_to_database(self, save_process_instance_events: bool = True) -> None:
|
||||
db.session.bulk_save_objects(self.bpmn_processes.values())
|
||||
db.session.bulk_save_objects(self.task_models.values())
|
||||
if save_process_instance_events:
|
||||
db.session.bulk_save_objects(self.process_instance_events.values())
|
||||
JsonDataModel.insert_or_update_json_data_records(self.json_data_dicts)
|
||||
|
||||
|
|
Loading…
Reference in New Issue