Skip to content

Fix config handling, provide poll interval#78

Merged
marktheunissen merged 5 commits intomasterfrom
75-cpu-refresh
Jun 29, 2013
Merged

Fix config handling, provide poll interval#78
marktheunissen merged 5 commits intomasterfrom
75-cpu-refresh

Conversation

@marktheunissen
Copy link
Copy Markdown
Member

Fixes #75

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a race condition? How can we be sure the config has been fetched before we reference it in setTimeout?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first poll is hardcoded to happen after 5s, so the config will be available. However I can put a check in to make sure it's not undefined.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. A check is good for now. Another thought is to serve the config as part of the HTML so we can be certain it's available without having to make an ajax call.

@pifantastic
Copy link
Copy Markdown
Member

This looks good to me (aside from the one comment). I like getting rid of the sample config file.

@marktheunissen
Copy link
Copy Markdown
Member Author

@ilario Are you sure you're running the latest code? The backend doesn't read config.sample.json anymore. It has the default values compiled in. It will attempt to read config.json if it exists, and any value in there will override the default.

marktheunissen added a commit that referenced this pull request Jun 29, 2013
Fix config handling, provide poll interval
@marktheunissen marktheunissen merged commit 3dc1ef8 into master Jun 29, 2013
@marktheunissen marktheunissen deleted the 75-cpu-refresh branch June 29, 2013 20:15
@ilario
Copy link
Copy Markdown

ilario commented Jun 29, 2013

You were right, I'm sorry, it was my fault (I was using old code due to a mistake in my launcher).

@marktheunissen
Copy link
Copy Markdown
Member Author

Great, glad it's working for you.

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.

Frequent refresh too CPU intensive

3 participants