Skip to content

Commit

Permalink
Delay gulp-watch read so watch task isn't broken on slower disks.
Browse files Browse the repository at this point in the history
vscode writes files non-atomically. This is useful on an azure devbox over ssh.
  • Loading branch information
roblourens committed Sep 9, 2019
1 parent 0a378fd commit bb02180
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/gulpfile.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const tasks = compilations.map(function (tsconfigFile) {
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
const pipeline = createPipeline(false);
const input = pipeline.tsProjectSrc();
const watchInput = watcher(src, srcOpts);
const watchInput = watcher(src, { ...srcOpts, ...{ readDelay: 200 } });

return watchInput
.pipe(util.incremental(pipeline, input))
Expand Down
2 changes: 1 addition & 1 deletion build/lib/compilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function watchTask(out, build) {
return function () {
const compile = createCompile('src', build);
const src = gulp.src('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
let generator = new MonacoGenerator(true);
generator.execute();
return watchSrc
Expand Down
2 changes: 1 addition & 1 deletion build/lib/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
const compile = createCompile('src', build);

const src = gulp.src('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });

let generator = new MonacoGenerator(true);
generator.execute();
Expand Down

0 comments on commit bb02180

Please sign in to comment.