Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissionControl seems to be using production.rb's queue database instead of development #168

Open
gczh opened this issue Oct 6, 2024 · 0 comments

Comments

@gczh
Copy link

gczh commented Oct 6, 2024

I'm trying to figure out if there is any way to determine the database that MissionControl is connected to. At the moment, what seems to be the case is this:

When running SolidQueue::Job.connection.raw_connection in rails console, it seems to be using the local database configured in database.yml

development:
  primary:
    <<: *default
    database: rails_app_development
  external:
    url: <%= ENV["EXTERNAL_DATABASE_URL"] %>
    database_tasks: false
    replica: true
  queue:
    <<: *default
    database: rails_app_development_queue
    migrations_paths: db/queue_migrate
    
production:
  primary:
    <<: *default
    database: rails_app_production
    url: <%= ENV["DATABASE_URL"] %>
  external:
    url: <%= ENV["EXTERNAL_DATABASE_URL"] %>
    database_tasks: false
    replica: true
  queue:
    <<: *default
    url: <%= ENV["QUEUE_DATABASE_URL"] %>
    database: rails_app_production_queue
    migrations_paths: db/queue_migrate

However, when I look at website.com/jobs and localhost:3000/jobs, it seems that the number of jobs completed is exactly the same. This leads me to believe that the MissionControl on localhost is actually pointing to the QUEUE_DATABASE_URL in database.yml

However, even after commenting out that in .env, it still seems to be connecting to the remote queue database.

Other notes

Looks like if I were to comment out the queue database configuration for production in database.yml, MissionControl would then point to development's database correctly.

I undid the comments after restarting the server, and it's still pointing to the local db, which is the correct and expected behaviour. This makes me wonder if MissionControl is caching database connections somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant