mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix System.OperationCanceledException Issue (#3091)
This commit is contained in:
parent
7e9ed8e47a
commit
6e4f6e2abf
1 changed files with 20 additions and 9 deletions
|
|
@ -60,15 +60,26 @@ namespace Flow.Launcher.Plugin.Program
|
|||
var result = await cache.GetOrCreateAsync(query.Search, async entry =>
|
||||
{
|
||||
var resultList = await Task.Run(() =>
|
||||
_win32s.Cast<IProgram>()
|
||||
.Concat(_uwps)
|
||||
.AsParallel()
|
||||
.WithCancellation(token)
|
||||
.Where(HideUninstallersFilter)
|
||||
.Where(p => p.Enabled)
|
||||
.Select(p => p.Result(query.Search, Context.API))
|
||||
.Where(r => r?.Score > 0)
|
||||
.ToList());
|
||||
{
|
||||
try
|
||||
{
|
||||
return _win32s.Cast<IProgram>()
|
||||
.Concat(_uwps)
|
||||
.AsParallel()
|
||||
.WithCancellation(token)
|
||||
.Where(HideUninstallersFilter)
|
||||
.Where(p => p.Enabled)
|
||||
.Select(p => p.Result(query.Search, Context.API))
|
||||
.Where(r => r?.Score > 0)
|
||||
.ToList();
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Fix #3091: System.OperationCanceledException Issue
|
||||
return emptyResults;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
resultList = resultList.Any() ? resultList : emptyResults;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue