fix(watcher): ignore transient ENOENT on ephemeral .lock files
This commit is contained in:
parent
3b7dc1f5e2
commit
644b45942f
1 changed files with 8 additions and 1 deletions
|
|
@ -485,7 +485,14 @@ export class FileWatcher extends EventEmitter {
|
||||||
watcher: fs.FSWatcher,
|
watcher: fs.FSWatcher,
|
||||||
watcherType: 'projects' | 'todos' | 'teams' | 'tasks'
|
watcherType: 'projects' | 'todos' | 'teams' | 'tasks'
|
||||||
): void {
|
): void {
|
||||||
watcher.on('error', (error) => {
|
watcher.on('error', (error: NodeJS.ErrnoException) => {
|
||||||
|
// Ephemeral .lock files cause harmless ENOENT when the recursive watcher
|
||||||
|
// tries to scandir a path that was already deleted. Log as debug and skip
|
||||||
|
// the teardown/retry — the watcher is still healthy.
|
||||||
|
if (error.code === 'ENOENT' && error.path?.endsWith('.lock')) {
|
||||||
|
logger.debug(`FileWatcher: ${watcherType} ignoring transient ENOENT on lock file`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
logger.error(`FileWatcher: ${watcherType} watcher error:`, error);
|
logger.error(`FileWatcher: ${watcherType} watcher error:`, error);
|
||||||
if (watcherType === 'projects') {
|
if (watcherType === 'projects') {
|
||||||
this.projectsWatcher = null;
|
this.projectsWatcher = null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue