Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes Issues #182 - Broken config file watching. #184

Merged
merged 1 commit into from

3 participants

Ciaran Jessup Daniel Schauenberg Peter Schuster
Ciaran Jessup

Implements fix as suggested by Peter Schuster in comment thread.

Signed-off-by: ciaranj ciaranj@gmail.com

lib/config.js
@@ -21,8 +21,8 @@ var Configurator = function (file) {
this.updateConfig();
- fs.watch(file, function (curr, prev) {
- if (curr.ino != prev.ino) { self.updateConfig(); }
+ fs.watch(file, function (event, filename) {
+ if (event != 'rename') { self.updateConfig(); }
Daniel Schauenberg Owner
mrtazz added a note

is there a reason why we test for != 'rename' and not just == 'change'? Judging from the docs only those two events are available and checking for the actual one we want might be more clear.

Ciaran Jessup
ciaranj added a note

True, I just cut'n'pasted the suggested patch to get a pull request in as this is so broken at the minute. Would you prefer it this way around ?

My thought was that 'rename' is clearly no change in content, so we can exclude it. But in case there will be more event types in the future (no idea what this could be), it won't harm to reload the config. With a condition on 'change' we would miss these. But at the moment it would not make any difference.

Daniel Schauenberg Owner
mrtazz added a note

I'm totally fine with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Ciaran Jessup

So, just to confirm I swap to == 'change' and we're good to merge?

Daniel Schauenberg
Owner

yup

Ciaran Jessup

Doneski ;)

Ciaran Jessup ciaranj Fixes Issues #182 - Broken config file watching.
Implements fix as suggested by Peter Schuster and Daniel
Schauenberg in comment thread.

Signed-off-by: ciaranj <ciaranj@gmail.com>
ad011af
Daniel Schauenberg
Owner

awesome! thanks for the patch.

Daniel Schauenberg mrtazz merged commit 5a4609f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 6, 2012
  1. Ciaran Jessup

    Fixes Issues #182 - Broken config file watching.

    ciaranj authored
    Implements fix as suggested by Peter Schuster and Daniel
    Schauenberg in comment thread.
    
    Signed-off-by: ciaranj <ciaranj@gmail.com>
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/config.js
4 lib/config.js
View
@@ -21,8 +21,8 @@ var Configurator = function (file) {
this.updateConfig();
- fs.watch(file, function (curr, prev) {
- if (curr.ino != prev.ino) { self.updateConfig(); }
+ fs.watch(file, function (event, filename) {
+ if (event == 'change') { self.updateConfig(); }
});
};
Something went wrong with that request. Please try again.