ejschmitt / delayed_job_web

Resque like web interface for delayed job
MIT License
479 stars 188 forks source link

Use Rails environment in /stats #116

Closed coffeejunk closed 2 years ago

coffeejunk commented 4 years ago

Use the Rails.env instead of Sinatra::Application.environment.

Sinatra depends on APP_ENV rather than RAILS_ENV and defaults to development if no APP_ENV is set. This can lead to situations where the host application is running in production but the dashboard is showing development.

Fixes #112

$ bin/www
=> Booting Puma
=> Rails 5.2.3 application starting in production
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:8082
Use Ctrl-C to stop
Screenshot 2019-12-13 20 11 31
andyatkinson commented 2 years ago

Is this still meaningful @coffeejunk - if this becomes part of the next release, are you able to test it? I don't know why the Sinatra env was used historically and what the implications are of this change to be honest. I appreciate the screenshot and think the change is probably fine, but I wouldn't have a way to test it to get more validation.

andyatkinson commented 2 years ago

I'll close for now but re-open if you're able to answer the above ^ Thanks.