fix(watcher): ensure provider folders exist before creating watchers to maintain active watching

This commit is contained in:
Haileyesus
2026-02-12 20:40:56 +03:00
parent 553c534f35
commit 4d41bfd366

View File

@@ -163,6 +163,10 @@ async function setupProjectsWatcher() {
for (const { provider, rootPath } of PROVIDER_WATCH_PATHS) { for (const { provider, rootPath } of PROVIDER_WATCH_PATHS) {
try { try {
// chokidar v4 emits ENOENT via the "error" event for missing roots and will not auto-recover.
// Ensure provider folders exist before creating the watcher so watching stays active.
await fsPromises.mkdir(rootPath, { recursive: true });
// Initialize chokidar watcher with optimized settings // Initialize chokidar watcher with optimized settings
const watcher = chokidar.watch(rootPath, { const watcher = chokidar.watch(rootPath, {
ignored: WATCHER_IGNORED_PATTERNS, ignored: WATCHER_IGNORED_PATTERNS,