Skip to content

Cannot init config with Rails credentials #31

@bendangelo

Description

@bendangelo

Hi, I can't use Rails.application.credentials with your initializer because it needs to be wrapped in this:

Rails.application.configure do
  config.after_initialize do

Here is my code that currently fails:

# frozen_string_literal: true

SolidQueueMonitor.setup do |config|
  # Enable or disable authentication
  # When disabled, no authentication is required to access the monitor
  config.authentication_enabled = true

  # Set the username for HTTP Basic Authentication (only used if authentication is enabled)
  config.username = Rails.application.credentials.dig(:mission_control, :http_basic_auth_user)

  # Set the password for HTTP Basic Authentication (only used if authentication is enabled)
  config.password = Rails.application.credentials.dig(:mission_control, :http_basic_auth_password)

  # Number of jobs to display per page
  # config.jobs_per_page = 25

  # Auto-refresh settings
  # Enable or disable auto-refresh globally (users can still toggle it in the UI)
  # config.auto_refresh_enabled = true

  # Auto-refresh interval in seconds (default: 30)
  # config.auto_refresh_interval = 30

  # Disable the chart on the overview page to skip chart queries entirely.
  # config.show_chart = true
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions