Plugin collect support different params

This commit is contained in:
710leo 2020-05-15 17:23:00 +08:00
parent 973f94f510
commit 99bd108901
2 changed files with 6 additions and 6 deletions

View File

@ -22,14 +22,14 @@ func DelNoUsePlugins(newPlugins map[string]*Plugin) {
} }
func AddNewPlugins(newPlugins map[string]*Plugin) { func AddNewPlugins(newPlugins map[string]*Plugin) {
for fpath, newPlugin := range newPlugins { for key, newPlugin := range newPlugins {
if _, ok := Plugins[fpath]; ok && newPlugin.MTime == Plugins[fpath].MTime { if _, ok := Plugins[key]; ok && newPlugin.MTime == Plugins[key].MTime {
continue continue
} }
Plugins[fpath] = newPlugin Plugins[key] = newPlugin
sch := NewPluginScheduler(newPlugin) sch := NewPluginScheduler(newPlugin)
PluginsWithScheduler[fpath] = sch PluginsWithScheduler[key] = sch
sch.Schedule() sch.Schedule()
} }
} }

View File

@ -29,7 +29,7 @@ func ListPluginsFromMonapi() map[string]*Plugin {
plugins := stra.Collect.GetPlugin() plugins := stra.Collect.GetPlugin()
for _, p := range plugins { for key, p := range plugins {
fpath := p.FilePath fpath := p.FilePath
plugin := &Plugin{ plugin := &Plugin{
FilePath: fpath, FilePath: fpath,
@ -38,7 +38,7 @@ func ListPluginsFromMonapi() map[string]*Plugin {
Params: p.Params, Params: p.Params,
} }
ret[fpath] = plugin ret[key] = plugin
} }
return ret return ret