Make SidekiqStatus opt-in
SidekiqStatus executes a Redis SET every time a job is enqueued. For scheduled jobs, this is done twice: once when it is first scheduled and another when it is actually enqueued.
Searching our codebase, we don't really use it for a lot of workers. We could make this opt-in so that only jobs with status_expiration defined would call this middleware.
A single SET isn't really that expensive but it can take quite a bit of time when enqueuing many jobs at once. Examples of this are:
- When Sidekiq enqueues scheduled jobs that are due: gitlab-com/gl-infra/scalability#1179 (comment 711058749)
- When we use
push_bulkto enqueue many jobs: gitlab-com/gl-infra/production#5808 (comment 715465960)