Improve performance of EmailsOnPushWorker
As noted in gitlab-com/gl-infra/scalability#264 (comment 316561096) , this Sidekiq job can take a long time to complete. A coupole of ideas, but it needs investigation ^^.
This worker generates its own diff using CompareService
. Does it respect diff limits?
We generate one in Git::BranchPushService
too, from memory - perhaps it could be shared between them?
We're also calling out to external email services, and that time is counted towards the execution time of this job. We could replace deliver_now
with deliver
to remove it from accounting and make it clearer when that side of things is responsible for slowness.