Skip to content

Commit

Permalink
set filter_by_id to None for each loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjiang committed Nov 25, 2024
1 parent ee0f913 commit fff067e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ezidapp/management/commands/proc-expunge.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ def run(self):
self.time_range = Q(createTime__gte=self.min_age_ts) & Q(createTime__lte=self.max_age_ts)

self.min_id, self.max_id = self.get_id_range_by_time(self.time_range)
filter_by_id = None

log.info(f"Initial time range: {self.time_range_str}, {self.time_range}")
log.info(f"Initial ID range: {self.min_id} : {self.max_id}")

while not self.terminated():
# TODO: This is a heavy query which can be optimized with better indexes or
# flags in the DB.
filter_by_id = None
if self.min_id is not None:
filter_by_id = Q(id__gte=self.min_id)
if self.max_id is not None:
Expand Down

0 comments on commit fff067e

Please sign in to comment.