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

Race conditions with gulp.watch? #429

Closed
th0r opened this issue Apr 24, 2014 · 6 comments
Closed

Race conditions with gulp.watch? #429

th0r opened this issue Apr 24, 2014 · 6 comments

Comments

@th0r
Copy link

th0r commented Apr 24, 2014

I have two tasks and watcher to recompile styles on-the-fly:

gulp.task('styles', ['clean.styles'], function () {
    return gulp
        .src('assets/*.styl')
        .pipe(stylus())
        .pipe(gulp.dest('public/styles'));
});

gulp.task('clean.styles', function () {
    return gulp
        .src('public/styles', {
            read: false
        })
        .pipe(clean());
});

gulp.task('watch', function () {
    gulp.watch('assets/*.styl', ['styles']);
});

Lets say I have two styl files in the assets directory and I run gulp watch. Then after some actions these files are changed almost simultaneously and I have the following output in the console:

[gulp] Starting 'clean.styles'...
[gulp] Finished 'clean.styles' after 933 μs
[gulp] Starting 'styles'...
[gulp] Starting 'clean.styles'...
[gulp] Finished 'styles' after 567 ms
[gulp] Finished 'clean.styles' after 3.34 ms

So, as you can see, clean.styles task is called twice (for both styl files) and the styles task called only once what results in the absent public/styles directory.

@yocontra
Copy link
Member

@robrich Did the old orchestrator make sure that dependencies were only executed once?

@robrich
Copy link
Contributor

robrich commented Apr 26, 2014

Dependencies: yes, actual watched task: no.

@carljm
Copy link

carljm commented Jul 14, 2014

Is this the same underlying issue as #557?

@durango
Copy link

durango commented Jul 14, 2014

Also experiencing this on mac osx 10.9

@th0r
Copy link
Author

th0r commented Jul 15, 2014

@carljm Yes, I think this is the same bug.

@yocontra
Copy link
Member

yocontra commented Sep 1, 2014

Rolling into #651

@yocontra yocontra closed this as completed Sep 1, 2014
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

No branches or pull requests

5 participants