File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Plugins/Flow.Launcher.Plugin.Program Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,8 @@ public async Task InitAsync(PluginInitContext context)
186186
187187 _settings = context . API . LoadSettingJsonStorage < Settings > ( ) ;
188188
189+ var _win32sCount = 0 ;
190+ var _uwpsCount = 0 ;
189191 await Stopwatch . NormalAsync ( "|Flow.Launcher.Plugin.Program.Main|Preload programs cost" , async ( ) =>
190192 {
191193 var pluginCachePath = Context . CurrentPluginMetadata . PluginCacheDirectoryPath ;
@@ -243,19 +245,18 @@ static void MoveFile(string sourcePath, string destinationPath)
243245
244246 await _win32sLock . WaitAsync ( ) ;
245247 _win32s = await context . API . LoadCacheBinaryStorageAsync ( Win32CacheName , pluginCachePath , new List < Win32 > ( ) ) ;
248+ _win32sCount = _win32s . Count ;
246249 _win32sLock . Release ( ) ;
247250
248251 await _uwpsLock . WaitAsync ( ) ;
249252 _uwps = await context . API . LoadCacheBinaryStorageAsync ( UwpCacheName , pluginCachePath , new List < UWPApp > ( ) ) ;
253+ _uwpsCount = _uwps . Count ;
250254 _uwpsLock . Release ( ) ;
251255 } ) ;
252- await _win32sLock . WaitAsync ( ) ;
253- await _uwpsLock . WaitAsync ( ) ;
254-
255- Log . Info ( $ "|Flow.Launcher.Plugin.Program.Main|Number of preload win32 programs <{ _win32s . Count } >") ;
256- Log . Info ( $ "|Flow.Launcher.Plugin.Program.Main|Number of preload uwps <{ _uwps . Count } >") ;
256+ Log . Info ( $ "|Flow.Launcher.Plugin.Program.Main|Number of preload win32 programs <{ _win32sCount } >") ;
257+ Log . Info ( $ "|Flow.Launcher.Plugin.Program.Main|Number of preload uwps <{ _uwpsCount } >") ;
257258
258- bool cacheEmpty = ! _win32s . Any ( ) || ! _uwps . Any ( ) ;
259+ var cacheEmpty = _win32sCount == 0 || _uwpsCount == 0 ;
259260
260261 _win32sLock . Release ( ) ;
261262 _uwpsLock . Release ( ) ;
You can’t perform that action at this time.
0 commit comments