mikeal/watch — Issue #20: walk: sometimes callback is not activated
Author: cmadsen
Created: 2011-12-20 08:11:23+00:00
State: open

There is a bug (I think) in:

function walk (dir, options, callback) {
if (!callback) {callback = options; options = {}}
if (!callback.files) callback.files = {};
if (!callback.pending) callback.pending = 0;
callback.pending += 1;
fs.stat(dir, function (err, stat) {

should be

function walk (dir, options, callback) {
if (!callback) {callback = options; options = {}}
if (!callback.files) callback.files = {};
if (!callback.pending) callback.pending = 0;
fs.stat(dir, function (err, stat) {
callback.pending += 1;

At least the change makes couchapp push work more reliably.