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

timeStatus timeNeedsSync never seted #23

Closed
dicson opened this issue Jan 13, 2019 · 4 comments
Closed

timeStatus timeNeedsSync never seted #23

dicson opened this issue Jan 13, 2019 · 4 comments

Comments

@dicson
Copy link

dicson commented Jan 13, 2019

Thanks for you work!
I think timeNeedsSync status never can be set. I did not find in the code timeNeedsSync and if I disable connection I always see status '2' (timeSet).
Maybe I'm wrong. Sorry for my bad english

@ropg
Copy link
Owner

ropg commented Feb 6, 2019

Sorry for the late reply. Will leave this open and investigate soon as I get some time to work on it.

@mike-s123
Copy link
Contributor

mike-s123 commented Feb 8, 2019

I think you want something like this at the end of updateNTP():

      if (queryNTP(_ntp_server, t, measured_at)) {
...
      } else {
        if ( nowUTC(false) > _last_sync_time + _ntp_interval + NTP_STALE_AFTER ) {
          _time_status = timeNeedsSync;
        }  
        UTC.setEvent(updateNTP, nowUTC(false) + NTP_RETRY);
      }

@ropg
Copy link
Owner

ropg commented Feb 10, 2019

Fixed by commit 1653955 from #29 (thanks!)

@ropg ropg closed this as completed Feb 10, 2019
@dicson
Copy link
Author

dicson commented Feb 10, 2019

Thank you very much!

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

3 participants