Skip to content

Only load usage ping cron schedule for Sidekiq

Stan Hu requested to merge sh-avoid-current-settings-rake-task into master

Previously the initializer always loaded the application_settings table in the initializer, even for Rake tasks (e.g. rake db:setup). This was done because the usage ping worker needed to load the UUID of the instance from the database to calculate the usage ping schedule. However, cron schedules are only needed by Sidekiq, so we can defer the calculation of this value in the Sidekiq initializer.

When loading application settings from the database, this should make it possible for us to raise errors when the connection is not present since this appears to be the only setting that is actually needed at init time.

This came out of a discussion in #205640 (closed).

Edited by Stan Hu

Merge request reports