Flush session once every 1000 records when bulk-deleting

This commit is contained in:
Lance Edgar 2017-08-10 16:32:03 -05:00
parent 46a43981df
commit 41e09271a2

View file

@ -816,6 +816,8 @@ class MasterView(View):
def delete(obj, i):
session.delete(obj)
if i % 1000 == 0:
session.flush()
self.progress_loop(delete, objects, progress,
message="Deleting objects")