@@ -1207,19 +1207,19 @@ private async Task QueryResultsAsync(int? searchDelay, bool isReQuery = false, b
1207
1207
}
1208
1208
1209
1209
// Local function
1210
- async ValueTask QueryTaskAsync ( PluginPair plugin , bool reSelect = true )
1210
+ async Task QueryTaskAsync ( bool searchDelay , PluginPair plugin , bool reSelect , CancellationToken token )
1211
+ {
1212
+ if ( ! searchDelay )
1211
1213
{
1212
1214
// Since it is wrapped within a ThreadPool Thread, the synchronous context is null
1213
1215
// Task.Yield will force it to run in ThreadPool
1214
1216
await Task . Yield ( ) ;
1215
-
1216
- if ( _updateSource . Token . IsCancellationRequested )
1217
- return ;
1217
+ }
1218
1218
1219
1219
IReadOnlyList < Result > results =
1220
- await PluginManager . QueryForPluginAsync ( plugin , query , _updateSource . Token ) ;
1220
+ await PluginManager . QueryForPluginAsync ( plugin , query , token ) ;
1221
1221
1222
- if ( _updateSource . Token . IsCancellationRequested )
1222
+ if ( token . IsCancellationRequested )
1223
1223
return ;
1224
1224
1225
1225
IReadOnlyList < Result > resultsCopy ;
@@ -1230,11 +1230,11 @@ async ValueTask QueryTaskAsync(PluginPair plugin, bool reSelect = true)
1230
1230
else
1231
1231
{
1232
1232
// make a copy of results to avoid possible issue that FL changes some properties of the records, like score, etc.
1233
- resultsCopy = DeepCloneResults ( results ) ;
1233
+ resultsCopy = DeepCloneResults ( results , token ) ;
1234
1234
}
1235
1235
1236
1236
if ( ! _resultsUpdateChannelWriter . TryWrite ( new ResultsForUpdate ( resultsCopy , plugin . Metadata , query ,
1237
- _updateSource . Token , reSelect ) ) )
1237
+ token , reSelect ) ) )
1238
1238
{
1239
1239
Log . Error ( "MainViewModel" , "Unable to add item to Result Update Queue" ) ;
1240
1240
}
0 commit comments