Plugin collect support different params
This commit is contained in:
parent
973f94f510
commit
99bd108901
|
@ -22,14 +22,14 @@ func DelNoUsePlugins(newPlugins map[string]*Plugin) {
|
|||
}
|
||||
|
||||
func AddNewPlugins(newPlugins map[string]*Plugin) {
|
||||
for fpath, newPlugin := range newPlugins {
|
||||
if _, ok := Plugins[fpath]; ok && newPlugin.MTime == Plugins[fpath].MTime {
|
||||
for key, newPlugin := range newPlugins {
|
||||
if _, ok := Plugins[key]; ok && newPlugin.MTime == Plugins[key].MTime {
|
||||
continue
|
||||
}
|
||||
|
||||
Plugins[fpath] = newPlugin
|
||||
Plugins[key] = newPlugin
|
||||
sch := NewPluginScheduler(newPlugin)
|
||||
PluginsWithScheduler[fpath] = sch
|
||||
PluginsWithScheduler[key] = sch
|
||||
sch.Schedule()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ func ListPluginsFromMonapi() map[string]*Plugin {
|
|||
|
||||
plugins := stra.Collect.GetPlugin()
|
||||
|
||||
for _, p := range plugins {
|
||||
for key, p := range plugins {
|
||||
fpath := p.FilePath
|
||||
plugin := &Plugin{
|
||||
FilePath: fpath,
|
||||
|
@ -38,7 +38,7 @@ func ListPluginsFromMonapi() map[string]*Plugin {
|
|||
Params: p.Params,
|
||||
}
|
||||
|
||||
ret[fpath] = plugin
|
||||
ret[key] = plugin
|
||||
}
|
||||
|
||||
return ret
|
||||
|
|
Loading…
Reference in New Issue