Skip to content

Update FindRecordsDueForRefreshService to use SQL queries

Hinam Mehra requested to merge 484754-replace-rails-methods-with-db-calls into master

What does this MR do and why?

Update FindRecordsDueForRefreshService to use SQL queries

  • Currently FindRecordsDueForRefreshService gets all the user's project_authorizations and loops through them to remove project_authorizations that are duplicate. Instead of doing this calculation in rails, this MR uses group by and having(count) to do them in SQL instead.
  • Currently, the AuthorizedProjectsWorker (which calls FindRecordsDueForRefreshService) is exceeding it's SLA. Once of the things we have noticed from the logs is the total duration for a job is double the database duration. So this MR attempts to reduce the total duration.
  • No change in functionality or result
  • Changelog isn't needed since change is behind FF

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #484754 (closed)

Edited by Hinam Mehra

Merge request reports

Loading