Fixing notify credentials job
To save the memory get cert and grade object directly from the db because by doing that we'll override the queryset evaluation and object won't be cached once it has gone out of scope. PROD-987
This commit is contained in:
@@ -64,9 +64,10 @@ def paged_query(queryset, delay, page_size):
|
||||
|
||||
if delay and page:
|
||||
time.sleep(delay)
|
||||
|
||||
for i, item in enumerate(subquery, start=1):
|
||||
yield page_start + i, item
|
||||
index = 0
|
||||
for item in subquery.iterator():
|
||||
index += 1
|
||||
yield page_start + index, item
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
Reference in New Issue
Block a user