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)
186
186
187
187
_settings = context . API . LoadSettingJsonStorage < Settings > ( ) ;
188
188
189
+ var _win32sCount = 0 ;
190
+ var _uwpsCount = 0 ;
189
191
await Stopwatch . NormalAsync ( "|Flow.Launcher.Plugin.Program.Main|Preload programs cost" , async ( ) =>
190
192
{
191
193
var pluginCachePath = Context . CurrentPluginMetadata . PluginCacheDirectoryPath ;
@@ -243,19 +245,18 @@ static void MoveFile(string sourcePath, string destinationPath)
243
245
244
246
await _win32sLock . WaitAsync ( ) ;
245
247
_win32s = await context . API . LoadCacheBinaryStorageAsync ( Win32CacheName , pluginCachePath , new List < Win32 > ( ) ) ;
248
+ _win32sCount = _win32s . Count ;
246
249
_win32sLock . Release ( ) ;
247
250
248
251
await _uwpsLock . WaitAsync ( ) ;
249
252
_uwps = await context . API . LoadCacheBinaryStorageAsync ( UwpCacheName , pluginCachePath , new List < UWPApp > ( ) ) ;
253
+ _uwpsCount = _uwps . Count ;
250
254
_uwpsLock . Release ( ) ;
251
255
} ) ;
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 } >") ;
257
258
258
- bool cacheEmpty = ! _win32s . Any ( ) || ! _uwps . Any ( ) ;
259
+ var cacheEmpty = _win32sCount == 0 || _uwpsCount == 0 ;
259
260
260
261
_win32sLock . Release ( ) ;
261
262
_uwpsLock . Release ( ) ;
You can’t perform that action at this time.
0 commit comments