Skip to content

Commit

Permalink
Speed up remove all annotations from an item.
Browse files Browse the repository at this point in the history
This needlessly loaded them into memory before discarding them.
  • Loading branch information
manthey committed May 24, 2022
1 parent f40ed1d commit 5eff835
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5eff835

Please sign in to comment.