From 37aa1ab80c0d35d329972f20de1352c56cb6e0ad Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Fri, 8 Nov 2024 11:06:15 -0500 Subject: [PATCH] ref: fix potential memory leak in CombinedQuerysetPaginator instance state was being stored on the class --- src/sentry/api/paginator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/api/paginator.py b/src/sentry/api/paginator.py index 173ce25e871486..f66c1e6eac1aa2 100644 --- a/src/sentry/api/paginator.py +++ b/src/sentry/api/paginator.py @@ -582,13 +582,13 @@ class CombinedQuerysetPaginator: multiplier = 1000000 # Use microseconds for date keys. using_dates = False - model_key_map = {} def __init__(self, intermediaries, desc=False, on_results=None, case_insensitive=False): self.desc = desc self.intermediaries = intermediaries self.on_results = on_results self.case_insensitive = case_insensitive + self.model_key_map = {} for intermediary in list(self.intermediaries): if intermediary.is_empty: self.intermediaries.remove(intermediary)