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

Stats shows incorrect environment #112

Open
srijak opened this issue May 7, 2019 · 4 comments
Open

Stats shows incorrect environment #112

srijak opened this issue May 7, 2019 · 4 comments

Comments

@srijak
Copy link

srijak commented May 7, 2019

Hello,

Thanks for creating this project: it's been easy to setup and use.

I came across the following issue and would love some clarification.

In the Stats page, the environment label is sourced from Sinatra::Application.environment[0], which depends on a APP_ENV enviroment variable[1].

It looks like setting this up doesn't affect anything other than that specific label because the DB connection used to get DelayedJob(s) is whatever rails is setup to use.

Is that correct? If so, would it make more sense to use the rails env value?

[0]https://github.com/ejschmitt/delayed_job_web/blob/master/lib/delayed_job_web/application/views/stats.erb#L8
[1]http://sinatrarb.com/configuration.html

@andyatkinson
Copy link
Collaborator

Hi @srijak - I don't have a test instance of this running, would you mind including a screenshot?

If you think this column is confusing or not very useful, we could simply remove it too. Or if you think a different label makes more sense, that works. What do you think would be best?

@coffeejunk
Copy link

I think I'm seeing the same issue:

$ 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-12 12 48 25

@andyatkinson
Copy link
Collaborator

@coffeejunk Would you like to submit a PR based on what @srijak said earlier, using the Rails env instead? Or not displaying anything if the ENV is not set, that might be another solution.

@coffeejunk
Copy link

@andyatkinson sure thing

coffeejunk added a commit to coffeejunk/delayed_job_web that referenced this issue Dec 14, 2019
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
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 a pull request may close this issue.

3 participants