Skip to content

Commit

Permalink
usePolling in watch mode to fix issue on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Oct 1, 2019
1 parent 8144a14 commit ccd82c7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/commands/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ export async function _watch(
});
};
const watcher = chokidar.watch(currentMigrationPath, {
/*
* Without `usePolling`, on Linux, you can prevent the watching from
* working by issuing `git stash && sleep 2 && git stash pop`. This is
* annoying.
*/
usePolling: true,

/*
* Some editors stream the writes out a little at a time, we want to wait
* for the write to finish before triggering.
*/
awaitWriteFinish: {
stabilityThreshold: 200,
pollInterval: 100,
Expand Down

0 comments on commit ccd82c7

Please sign in to comment.