mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add log handler for indexing
This commit is contained in:
parent
68268026de
commit
4c4a6c0e22
1 changed files with 36 additions and 16 deletions
|
|
@ -283,32 +283,52 @@ namespace Flow.Launcher.Plugin.Program
|
|||
|
||||
public static async Task IndexWin32ProgramsAsync()
|
||||
{
|
||||
var win32S = Win32.All(_settings);
|
||||
await _win32sLock.WaitAsync();
|
||||
_win32s.Clear();
|
||||
foreach (var win32 in win32S)
|
||||
try
|
||||
{
|
||||
_win32s.Add(win32);
|
||||
var win32S = Win32.All(_settings);
|
||||
_win32s.Clear();
|
||||
foreach (var win32 in win32S)
|
||||
{
|
||||
_win32s.Add(win32);
|
||||
}
|
||||
ResetCache();
|
||||
await Context.API.SaveCacheBinaryStorageAsync<List<Win32>>(Win32CacheName, Context.CurrentPluginMetadata.PluginCacheDirectoryPath);
|
||||
_settings.LastIndexTime = DateTime.Now;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception("|Flow.Launcher.Plugin.Program.Main|Failed to index Win32 programs", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_win32sLock.Release();
|
||||
}
|
||||
ResetCache();
|
||||
await Context.API.SaveCacheBinaryStorageAsync<List<Win32>>(Win32CacheName, Context.CurrentPluginMetadata.PluginCacheDirectoryPath);
|
||||
_settings.LastIndexTime = DateTime.Now;
|
||||
_win32sLock.Release();
|
||||
}
|
||||
|
||||
public static async Task IndexUwpProgramsAsync()
|
||||
{
|
||||
var uwps = UWPPackage.All(_settings);
|
||||
await _uwpsLock.WaitAsync();
|
||||
_uwps.Clear();
|
||||
foreach (var uwp in uwps)
|
||||
try
|
||||
{
|
||||
_uwps.Add(uwp);
|
||||
var uwps = UWPPackage.All(_settings);
|
||||
_uwps.Clear();
|
||||
foreach (var uwp in uwps)
|
||||
{
|
||||
_uwps.Add(uwp);
|
||||
}
|
||||
ResetCache();
|
||||
await Context.API.SaveCacheBinaryStorageAsync<List<UWPApp>>(UwpCacheName, Context.CurrentPluginMetadata.PluginCacheDirectoryPath);
|
||||
_settings.LastIndexTime = DateTime.Now;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception("|Flow.Launcher.Plugin.Program.Main|Failed to index Uwp programs", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_uwpsLock.Release();
|
||||
}
|
||||
ResetCache();
|
||||
await Context.API.SaveCacheBinaryStorageAsync<List<UWPApp>>(UwpCacheName, Context.CurrentPluginMetadata.PluginCacheDirectoryPath);
|
||||
_settings.LastIndexTime = DateTime.Now;
|
||||
_uwpsLock.Release();
|
||||
}
|
||||
|
||||
public static async Task IndexProgramsAsync()
|
||||
|
|
|
|||
Loading…
Reference in a new issue