8000 NTP doesn't fire events when you leave the index page. · Issue #43 · gmag11/FSBrowserNG · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NTP doesn't fire events when you leave the index page. #43

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

Open
ddamron opened this issue Jan 31, 2018 · 0 comments
Open

NTP doesn't fire events when you leave the index page. #43

ddamron opened this issue Jan 31, 2018 · 0 comments

Comments

@ddamron
Copy link
ddamron commented Jan 31, 2018

I'm trying to do some time sensitive calculations. My calculations are to calibrate an RTC using NTP.
I'm finding the NTP events are only firing while I have the graphs page open. Once I change pages, it disables the events. How to I keep the NTP events firing?

Here is a snippet of code taken from my modified AsyncFSWebserver::begin

if (_config.updateNTPTimeEvery > 0) { // Enable NTP sync
NTP.begin(_config.ntpServerName, _config.timezone / 10, _config.daylight);
NTP.setInterval(15, _config.updateNTPTimeEvery * 60);
NTP.onNTPSyncEvent ([&](NTPSyncEvent_t event) {
ntpEvent = event;
syncEventTriggered = true;
});
}

This works as long as I'm looking at the web page. (ie /events)

Once I leave that page (or close it) the events stop completely, including the NTP event..

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

1 participant
0