From 5eff835b57c1f8cea22ae41d89d610cc82614d5e Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 24 May 2022 14:14:25 -0400 Subject: [PATCH] Speed up remove all annotations from an item. This needlessly loaded them into memory before discarding them. --- .../girder_large_image_annotation/rest/annotation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/girder_annotation/girder_large_image_annotation/rest/annotation.py b/girder_annotation/girder_large_image_annotation/rest/annotation.py index d36f224e7..e4ca0e453 100644 --- a/girder_annotation/girder_large_image_annotation/rest/annotation.py +++ b/girder_annotation/girder_large_image_annotation/rest/annotation.py @@ -552,7 +552,7 @@ def deleteItemAnnotations(self, item): count = 0 for annotation in Annotation().find(query, limit=0, sort=[('_id', 1)]): - annot = Annotation().load(annotation['_id'], user=user) + annot = Annotation().load(annotation['_id'], user=user, getElements=False) if annot: Annotation().remove(annot) count += 1