opensumi / core

🚀 A framework helps you quickly build AI Native IDE products. https://preview.opensumi.com
https://opensumi.com
MIT License
2.81k stars 354 forks source link

fix: will watch same folder multiple times #3816

Closed bytemain closed 2 weeks ago

bytemain commented 2 weeks ago

Types

Background or solution

之前的逻辑有判断要 watch 的路径是否已经被 watch 了,但是因为 async await 的原因,前端同时请求过来三四个一样的路径,后端会同时 watch 这些路径。

同时也优化了一些性能问题,原来的代码里检测文件夹是否存在时使用了 Sync 方法,这会导致处理文件监听时 Node 层会同步卡住进行的。

Changelog

fix file service will watch same folder multiple times

bytemain commented 2 weeks ago

又改的太多了.. 测试跑不过,稍后重新提个