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:
adeelehsan
2019-11-13 22:33:33 +05:00
parent 439e4b4169
commit e32e39e099

View File

@@ -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):