Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Stop the watchFileChecker callback from being called twice (closes #110) #113

merged 0 commits into from

4 participants


See the title and commits.


@dylanmcd can I get your eyes on this pull request - it's inside your update to nodemon and truth be told, I'm losing track a little! :)


@drewyoung1 code could do with a comment or two - I get the "fix app starting multiple times" - but how?

@remy remy referenced this pull request

Express with Nodemon #110


@remy @drewyoung1 That solution is fine, but I think a simpler way would be to do., function(event, filename) {
  if (watchFileChecker.changeDetected) { return; }
  watchFileChecker.changeDetected = true;

If changeDetected has been toggled, we know the callback has been called already. Only requires one added line, if (watchFileChecker.changeDetected) { return; }. Is that ok with you drew?


But watchFileChecker.verify also calls cb


Only if changeDetected is false, and if it's false, that means that the callback never got called. What's going on here is a test to see if works. If it does, changeDetected will get toggled to true. If it doesn't, then when the timeout fires, verify will see that changeDetected hasn't been toggled to true, and will call the callback with false, letting the program know that isn't supported. There cannot be a circumstance where both verify and callbacks are both triggered.

The memory leak seems to be caused by triggering more than once for some reason.




Oh. I don't think that's what you were talking about.
Ok I'll do it in the callback.

@CoderPuppy CoderPuppy merged commit 08e5aa1 into from

So how did that get merged the instant I pushed???


I don't know, doesn't look like it actually got merged...want me to just do the one line patch through the git interface?


Can you test that @drewyoung1 and make sure it's working, as I can't reproduce it here. Thanks for your help on this.


It seems this fix somehow hasn't made it into the repo yet? I was suffering the same problem, copy pasted the one liner and all seems well.

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

Sorry, commit information is not available for this pull request.

Something went wrong with that request. Please try again.