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

Config polling interval does not stop on resetting config #55

Open
Download opened this issue Mar 30, 2021 · 1 comment · May be fixed by #58
Open

Config polling interval does not stop on resetting config #55

Download opened this issue Mar 30, 2021 · 1 comment · May be fixed by #58
Assignees
Labels

Comments

@Download
Copy link
Owner

Split off from #52 where @Messj1 wrote:

BTW: There seems to be a bug 🐛 in the code. The interval get not stopped if someone call ulog.set("log_config", {});

set: function(name) {
if (name === 'log_config') config.update(this)

Maybe a destructor callback would do the trick. At the end, watch.browser.js would look something like that:

module.exports = function(ulog, pollingTimeout) {
  const intervalId = window.setInterval(watchFnc, pollingTimeout);
  return () => {
      window.clearInterval(intervalId);
  }
}
@Download Download added the bug label Mar 30, 2021
@Download
Copy link
Owner Author

@Messj1 can you elaborate on this one? I agree that starting a timer and never stopping it is not the best. But I'm not sure where ulog.set('log_config', {}) comes in. In ulog, you only get and set strings. Not objects. Also, the log_config setting is unused in the browser. It allows you to configure the path to the config file on Node JS.

@Download Download self-assigned this Mar 30, 2021
@Messj1 Messj1 linked a pull request Apr 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant