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

Changing files rapidly causes build to fail #41

Closed
Rich-Harris opened this issue Apr 2, 2015 · 1 comment
Closed

Changing files rapidly causes build to fail #41

Rich-Harris opened this issue Apr 2, 2015 · 1 comment

Comments

@Rich-Harris
Copy link
Contributor

I believe this is a regression - fairly sure this used to work. If you hammer Cmd-S (or Ctrl-S, if you're one of those people), it's easy to cause gobble to fall over - something about waiting forever for the first build (aborted by the start of the second one) to finish.

@Rich-Harris
Copy link
Contributor Author

God, this was a tough one to nail down. Turned out the problem was caused by invalidating the build while a file transformation was taking place - this could cause a queued task to never complete (i.e. neither fulfil nor reject supplied here would ever be called).

It's fixed in 0.7.10, but without a test, so I'll leave this open until I can get round to that.

The smallest test case I could come up with was this:

var gobble = require( 'gobble' );

function block ( input ) {
  var time = Date.now();
  while ( Date.now() - time < 1000 ) {
    // blockety block
  }
  return input;
}

module.exports = gobble([
  gobble( 'src/app' ).exclude( 'bar/**' ),
  gobble( 'src/app/bar' )
]).transform( block );

The src/app and src/app/bar directories contain a file each. Bashing Cmd-S while the block transformation was taking place would generally trigger the bug.

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

No branches or pull requests

1 participant