-
- Downloads
There was an error fetching the commit references. Please try again later.
Smarter refreshing of authorized projects
Prior to this commit the refreshing of authorized projects was done in two steps: 1. Remove existing authorizations 2. Insert a new list of all authorizations This can lead to a high amount of dead tuples as every time all rows are being replaced. For example, if a user with 100 authorizations is given access to a new project this would lead to: * 100 rows being removed * 101 new rows being inserted This commit changes the way this system works so it only removes/inserts what is necessary. Using the above example this would lead to only 1 new row being inserted, with the initial 100 being left untouched. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/25257
parent
a50cd9eb
No related branches found
No related tags found
Pipeline #
Showing
- app/models/project_authorization.rb 13 additions, 0 deletionsapp/models/project_authorization.rb
- app/models/user.rb 10 additions, 28 deletionsapp/models/user.rb
- app/services/users/refresh_authorized_projects_service.rb 128 additions, 0 deletionsapp/services/users/refresh_authorized_projects_service.rb
- app/workers/authorized_projects_worker.rb 1 addition, 21 deletionsapp/workers/authorized_projects_worker.rb
- spec/models/project_authorization_spec.rb 25 additions, 0 deletionsspec/models/project_authorization_spec.rb
- spec/services/users/refresh_authorized_projects_service_spec.rb 185 additions, 0 deletions...ervices/users/refresh_authorized_projects_service_spec.rb
- spec/workers/authorized_projects_worker_spec.rb 2 additions, 12 deletionsspec/workers/authorized_projects_worker_spec.rb
spec/models/project_authorization_spec.rb
0 → 100644
-
mentioned in issue #26126 (closed)
-
mentioned in issue #26194 (closed)
Please register or sign in to comment