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) {
|
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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue