mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
fix #189 startup is too slow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
using Wox.Plugin;
|
||||
@@ -20,19 +21,16 @@ namespace Wox.PluginLoader
|
||||
plugins.AddRange(new CSharpPluginLoader().LoadPlugin(pluginMetadatas));
|
||||
plugins.AddRange(new BasePluginLoader<PythonPlugin>().LoadPlugin(pluginMetadatas));
|
||||
|
||||
Forker forker = new Forker();
|
||||
foreach (PluginPair pluginPair in plugins)
|
||||
{
|
||||
PluginPair pair = pluginPair;
|
||||
forker.Fork(() => pair.Plugin.Init(new PluginInitContext()
|
||||
ThreadPool.QueueUserWorkItem(o => pair.Plugin.Init(new PluginInitContext()
|
||||
{
|
||||
CurrentPluginMetadata = pair.Metadata,
|
||||
Proxy = HttpProxy.Instance,
|
||||
API = App.Window
|
||||
}));
|
||||
}
|
||||
|
||||
forker.Join();
|
||||
}
|
||||
|
||||
public static List<PluginPair> AllPlugins
|
||||
|
||||
Reference in New Issue
Block a user