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,10 +117,11 @@ 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())
|
||||
db.session.bulk_save_objects(self.process_instance_events.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)
|
||||
|
||||
def process_parents_and_children_and_save_to_database(
|
||||
|
|
Loading…
Reference in New Issue