File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,8 @@ def _cull(self, num):
125125 else :
126126 keep_num = num - num // self ._cull_frequency
127127 try :
128- # Delete from the first expiration date.
128+ # Find the first entry beyond the retention limit,
129+ # prioritizing earlier expiration dates.
129130 deleted_from = next (
130131 self .collection_for_write .aggregate (
131132 [
@@ -137,10 +138,12 @@ def _cull(self, num):
137138 )
138139 )
139140 except StopIteration :
140- # Empty result , nothing to delete.
141+ # No entries found beyond the retention limit , nothing to delete.
141142 pass
142143 else :
143- # Remove from key.
144+ # Delete all entries with an earlier expiration date.
145+ # If multiple entries share the same expiration date,
146+ # delete those with a greater or equal key.
144147 self .collection_for_write .delete_many (
145148 {
146149 "$or" : [
You can’t perform that action at this time.
0 commit comments