Skip to content

Commit d3f06ab

Browse files
yyosifovdtopuzov
authored andcommitted
Add awaitWriteFinish option to choki in livesync to wait file to be r… (#2817)
* Add awaitWriteFinish option to choki in livesync to wait file to be ready to be read * set the threshold for 500ms
1 parent 94a3132 commit d3f06ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/services/livesync/livesync-service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ class LiveSyncService implements ILiveSyncService {
106106
}
107107
}
108108

109-
let watcher = choki.watch(pattern, { ignoreInitial: true, cwd: syncWorkingDirectory }).on("all", (event: string, filePath: string) => {
109+
let watcher = choki.watch(pattern, { ignoreInitial: true, cwd: syncWorkingDirectory,
110+
awaitWriteFinish: {
111+
stabilityThreshold: 500,
112+
pollInterval: 100
113+
}, }).on("all", (event: string, filePath: string) => {
110114
that.$dispatcher.dispatch(async () => {
111115
try {
112116
filePath = path.join(syncWorkingDirectory, filePath);

0 commit comments

Comments
 (0)