Speed up project creation for users with many projects
When a user creates a project in a group, we refresh the `authorized_projects` table for all members of that group using Sidekiq. This includes the user that created the project, but that alone would mean that if the Sidekiq job didn't finish almost immediately, a user could create a project that they'd be unable to see for a few seconds. We solved this by immediately refreshing all the projects for the user who created the project. However, that in turn can be quite slow, because we need to recompute the entire project authorization structure for a user. This commit changes that to just insert a single row to `authorized_projects` for the user who created the project. It should be accurate all the time, but if it is not quite right, the Sidekiq job will correct it shortly after anyway.
Showing
Please register or sign in to comment