@@ -231,7 +231,6 @@ function m.getLibraryMatchers(scp)
231231end
232232
233233--- 文件是否被忽略
234- --- @async
235234--- @param uri uri
236235function m .isIgnored (uri )
237236 local scp = scope .getScope (uri )
@@ -308,7 +307,13 @@ function m.awaitPreload(scp)
308307
309308 if scp .uri and not scp :get (' bad root' ) then
310309 log .info (' Scan files at:' , scp :getName ())
311- scp :gc (fw .watch (m .normalize (furi .decode (scp .uri )), true ))
310+ scp :gc (fw .watch (m .normalize (furi .decode (scp .uri )), true , function (path )
311+ local uri = furi .encode (path )
312+ if m .isIgnored (uri ) and not files .isLibrary (uri ) then
313+ return false
314+ end
315+ return true
316+ end ))
312317 local count = 0
313318 --- @async
314319 native :scan (furi .decode (scp .uri ), function (path )
@@ -326,7 +331,13 @@ function m.awaitPreload(scp)
326331 for _ , libMatcher in ipairs (librarys ) do
327332 log .info (' Scan library at:' , libMatcher .uri )
328333 local count = 0
329- scp :gc (fw .watch (furi .decode (libMatcher .uri ), true ))
334+ scp :gc (fw .watch (furi .decode (libMatcher .uri ), true , function (path )
335+ local uri = furi .encode (path )
336+ if m .isIgnored (uri ) and not files .isLibrary (uri ) then
337+ return false
338+ end
339+ return true
340+ end ))
330341 scp :addLink (libMatcher .uri )
331342 --- @async
332343 libMatcher .matcher :scan (furi .decode (libMatcher .uri ), function (path )
0 commit comments