File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed
Plugins/Flow.Launcher.Plugin.Program Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,26 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
6060 var result = await cache . GetOrCreateAsync ( query . Search , async entry =>
6161 {
6262 var resultList = await Task . Run ( ( ) =>
63- _win32s . Cast < IProgram > ( )
64- . Concat ( _uwps )
65- . AsParallel ( )
66- . WithCancellation ( token )
67- . Where ( HideUninstallersFilter )
68- . Where ( p => p . Enabled )
69- . Select ( p => p . Result ( query . Search , Context . API ) )
70- . Where ( r => r ? . Score > 0 )
71- . ToList ( ) ) ;
63+ {
64+ try
65+ {
66+ return _win32s . Cast < IProgram > ( )
67+ . Concat ( _uwps )
68+ . AsParallel ( )
69+ . WithCancellation ( token )
70+ . Where ( HideUninstallersFilter )
71+ . Where ( p => p . Enabled )
72+ . Select ( p => p . Result ( query . Search , Context . API ) )
73+ . Where ( r => r ? . Score > 0 )
74+ . ToList ( ) ;
75+ }
76+ catch ( OperationCanceledException )
77+ {
78+ Log . Debug ( "|Flow.Launcher.Plugin.Program.Main|Query operation cancelled" ) ;
79+ return emptyResults ;
80+ }
81+
82+ } , token ) ;
7283
7384 resultList = resultList . Any ( ) ? resultList : emptyResults ;
7485
You can’t perform that action at this time.
0 commit comments