@lvce-editor/file-watcher-process 4.5.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1397,6 +1397,15 @@ const watchFolders = async ({
|
|
|
1397
1397
|
} of watcherEntries) {
|
|
1398
1398
|
watcher.on('all', callback);
|
|
1399
1399
|
}
|
|
1400
|
+
const controller = new AbortController();
|
|
1401
|
+
controller.signal.addEventListener('abort', () => {
|
|
1402
|
+
void Promise.allSettled(watcherEntries.map(({
|
|
1403
|
+
watcher
|
|
1404
|
+
}) => watcher.close()));
|
|
1405
|
+
}, {
|
|
1406
|
+
once: true
|
|
1407
|
+
});
|
|
1408
|
+
add(id, controller);
|
|
1400
1409
|
const inotifyWatchCount = await getInotifyWatchCount();
|
|
1401
1410
|
if (inotifyWatchCount === undefined) {
|
|
1402
1411
|
return success;
|