revert unintended remove of await TaskScheduler.Default back

This commit is contained in:
Kevin Zhang 2021-06-25 14:43:47 +08:00 committed by 张弘韬
parent 89bb169fee
commit 11ca5f9bf3

View file

@ -482,6 +482,9 @@ namespace Flow.Launcher.ViewModel
ProgressBarVisibility = Visibility.Hidden;
_isQueryRunning = true;
// Switch to ThreadPool thread
await TaskScheduler.Default;
var query = QueryBuilder.Build(QueryText.Trim(), PluginManager.NonGlobalPlugins);
// handle the exclusiveness of plugin using action keyword
@ -543,7 +546,7 @@ namespace Flow.Launcher.ViewModel
// Local function
async Task QueryTask(PluginPair plugin)
{
// Since it is wrapped within a Task.Run, the synchronous context is null
// Since it is wrapped within a ThreadPool Thread, the synchronous context is null
// Task.Yield will force it to run in ThreadPool
await Task.Yield();