Skip to content

Commit d141699

Browse files
committed
Improvement - Using update instead of looping over objects
1 parent 922589d commit d141699

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

dbaas/notification/tasks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,7 @@ def migrate_engine(self, database, user, task, since_step=0):
789789
)
790790

791791
# Setting new Instance Type for all instances
792-
for instance in infra.instances.all():
793-
instance.instance_type = instance_type
794-
instance.save()
792+
infra.instances.update(instance_type=instance_type)
795793

796794
database_migrate_engine_obj.set_success()
797795
task.update_status_for(TaskHistory.STATUS_SUCCESS, 'Done')

0 commit comments

Comments
 (0)