check cancellation to avoid racing issue.

This commit is contained in:
Kevin Zhang 2021-06-26 15:42:27 +08:00 committed by 张弘韬
parent 11ca5f9bf3
commit 9d9b5323c6

View file

@ -485,6 +485,9 @@ namespace Flow.Launcher.ViewModel
// Switch to ThreadPool thread
await TaskScheduler.Default;
if (currentCancellationToken.IsCancellationRequested)
return;
var query = QueryBuilder.Build(QueryText.Trim(), PluginManager.NonGlobalPlugins);
// handle the exclusiveness of plugin using action keyword