@@ -228,6 +228,7 @@ function m.awaitLoadFile(uri)
228228 log .info (' Scan files at:' , uri )
229229 --- @async
230230 native :scan (furi .decode (uri ), function (path )
231+ scp :get (' cachedUris' )[furi .encode (path )] = true
231232 ld :loadFile (furi .encode (path ))
232233 end )
233234 ld :loadAll ()
@@ -275,6 +276,7 @@ function m.awaitPreload(scp)
275276 log .info (' Scan files at:' , scp :getName ())
276277 --- @async
277278 native :scan (furi .decode (scp .uri ), function (path )
279+ scp :get (' cachedUris' )[furi .encode (path )] = true
278280 ld :loadFile (furi .encode (path ))
279281 end )
280282 end
@@ -284,6 +286,7 @@ function m.awaitPreload(scp)
284286 scp :addLink (libMatcher .uri )
285287 --- @async
286288 libMatcher .matcher :scan (furi .decode (libMatcher .uri ), function (path )
289+ scp :get (' cachedUris' )[furi .encode (path )] = true
287290 ld :loadFile (furi .encode (path ), libMatcher .uri )
288291 end )
289292 watchers [# watchers + 1 ] = fw .watch (furi .decode (libMatcher .uri ))
@@ -401,10 +404,10 @@ end
401404--- @param scp scope
402405function m .flushFiles (scp )
403406 local cachedUris = scp :get ' cachedUris'
407+ scp :set (' cachedUris' , {})
404408 if not cachedUris then
405409 return
406410 end
407- scp :set (' cachedUris' , nil )
408411 for uri in pairs (cachedUris ) do
409412 files .delRef (uri )
410413 end
0 commit comments