Skip to content

Commit 58495da

Browse files
committed
enable polling for file watching in all cases
1 parent 00bcfe6 commit 58495da

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/packages/backend/watcher.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,20 @@ export class Watcher extends EventEmitter {
3232
private interval: number;
3333
private watcher: FSWatcher;
3434

35-
constructor(path: string, interval: number=300, debounce: number=0) {
35+
constructor(path: string, interval: number = 300, debounce: number = 0) {
3636
super();
3737
this.path = path;
3838
this.interval = interval;
3939

4040
L.debug(`${path}: interval=${interval}, debounce=${debounce}`);
4141
this.watcher = watch(this.path, {
42-
interval: this.interval, // only effective if we end up forced to use polling
42+
interval: this.interval,
43+
// polling is critical for network mounted filesystems,
44+
// and given architecture of cocalc there is no easy way around this.
45+
// E.g., on compute servers, everything breaks involving sync or cloudfs,
46+
// and in shared project s3/gcsfuse/sshfs would all break. So we
47+
// use polling.
48+
usePolling: true,
4349
persistent: false,
4450
alwaysStat: true,
4551
atomic: true,

0 commit comments

Comments
 (0)