datahub icon indicating copy to clipboard operation
datahub copied to clipboard

Fix script pagination

Open ryanlovett opened this issue 2 years ago • 0 comments

Bug description

scripts/delete-unused-users.py retrieves lists of users from the hub and then deletes ORM entries for inactive users. It does not paginate through the users properly however so one must keep the script running in a loop.

scripts/rsync-active-users.py also loops over a list of users, though in a different way. @yuvipanda reports that it is affected too however.

Environment & setup

  • Hub:
  • Language:

How to reproduce

Run delete-unused-users.py on a hub with >> 200 users and observe that it only goes through 199 users. If you repeat the command, the script will fetch a new list of users and so on, until there are less than 200 users. (assuming there are actually less than 200 active users)

ryanlovett avatar Jan 04 '23 21:01 ryanlovett