Skip to content

Commit

Permalink
remove unnecessary database cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Nov 26, 2024
1 parent 2ea9f01 commit 19f7379
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions osf/metrics/reporters/institutional_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
from ._base import MonthlyReporter


_CHUNK_SIZE = 500


class InstitutionalUsersReporter(MonthlyReporter):
'''build an InstitutionalUserReport for each institution-user affiliation
Expand All @@ -34,7 +31,7 @@ def iter_report_kwargs(self, continue_after: dict | None = None):
_user_qs = _institution.get_institution_users().filter(created__lt=_before_datetime)
if continue_after and (_institution.pk == continue_after['institution_pk']):
_user_qs = _user_qs.filter(pk__gt=continue_after['user_pk'])
for _user_pk in _user_qs.values_list('pk', flat=True).iterator(chunk_size=_CHUNK_SIZE):
for _user_pk in _user_qs.values_list('pk', flat=True):
yield {'institution_pk': _institution.pk, 'user_pk': _user_pk}

def report(self, **report_kwargs):
Expand Down

0 comments on commit 19f7379

Please sign in to comment.