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

Use Rails environment in /stats #116

Closed
wants to merge 1 commit into from

Conversation

coffeejunk
Copy link

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

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 ejschmitt#112
@andyatkinson
Copy link
Collaborator

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
Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

Stats shows incorrect environment
2 participants