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 server time zone when displaying last run #3

Closed
wants to merge 1 commit into from

Conversation

ivanovv
Copy link

@ivanovv ivanovv commented Feb 13, 2020

This PR changes the output of heartbeat and last run values, they are formatted using current time zone.

@ivanovv
Copy link
Author

ivanovv commented Mar 27, 2020

@ankane ping! :)

@ankane
Copy link
Owner

ankane commented Mar 27, 2020

Hey @ivanovv, thanks for the PR. Can you give an example of the before and after output, as well as remove any style changes from the PR?

@ivanovv ivanovv force-pushed the user_server_timezone branch from c1bfea1 to 2a0b39d Compare March 27, 2020 21:16
@ankane
Copy link
Owner

ankane commented Apr 16, 2020

Hey @ivanovv, saw you remove the style changes, but still not sure I understand how this changes the output. As far as I know, time_ago_in_words shows the relative difference and isn't affected by time zones.

@ivanovv
Copy link
Author

ivanovv commented Apr 30, 2020

Hey @ankane, you are right, I think there was some sort of a glitch – when we first started using your gem to check how clockwork is doing, I think there was a 1 hour difference (we are in UTC+1 timezone), but now, if I switch to pristine version of this gem I see no changes in output.

Interestingly, I also don't see anything in Rails commit history that might explain the discrepancy that my commit was intended to fix.

I'm closing the issue as we are switching to pristine version of this gem.

Thanks a lot for your work!!! ❤️

@ivanovv ivanovv closed this Apr 30, 2020
@ivanovv
Copy link
Author

ivanovv commented May 7, 2020

Hey @ankane, I finally got to the bottom of this and it turned out we are using this gem https://github.com/radar/distance_of_time_in_words which has this issue radar/distance_of_time_in_words#63 :(

irb(main):093:0> helper.time_ago_in_words(ClockworkWeb.last_heartbeat)
=> "1 hour and 6 seconds"
irb(main):094:0> helper.time_ago_in_words(ClockworkWeb.last_heartbeat.in_time_zone)
=> "6 seconds"

@ankane
Copy link
Owner

ankane commented May 8, 2020

That sounds like a tricky one to track down... thanks for the update!

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.

2 participants