Reduce SQL queries when no pipeline hooks are active
If no pipeline hooks are active for a project, we still go through the trouble of generating the hook data, which may make a number of SQL, Gitaly, and Redis calls unnecessarily. Most projects don't have any hooks, so we can reduce the amount of load by only building the hook data if there are active hooks or services. This requires several cheap SQL queries. Note that the optimal way would be to lazily load the hook data, but that requires more complex changes. This is a similar optimization that was implemented for PostReceive (https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/31741). Relates to https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/12055
Showing
Please register or sign in to comment