• Stan Hu's avatar
    Only load usage ping cron schedule for Sidekiq · 435e913d
    Stan Hu authored
    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 theins 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
    https://gitlab.com/gitlab-org/gitlab/issues/205640.
    435e913d
1_settings.rb 37.8 KB