Template
fix: make template build, lint and test cleanly out of the box
This commit is contained in:
@@ -65,11 +65,13 @@ func (p *Plugin) OnConfigurationChange() error {
|
||||
p.API.LogInfo("OnConfigurationChange")
|
||||
var configuration = new(Configuration)
|
||||
// Load the public Configuration fields from the Mattermost server Configuration.
|
||||
err := p.API.LoadPluginConfiguration(configuration)
|
||||
if err == nil {
|
||||
p.SetConfiguration(configuration)
|
||||
return nil
|
||||
} else {
|
||||
if err := p.API.LoadPluginConfiguration(configuration); err != nil {
|
||||
return errors.Wrap(err, "failed to load plugin Configuration")
|
||||
}
|
||||
p.SetConfiguration(configuration)
|
||||
|
||||
if err := p.initTelemetry(p.API.GetConfig().LogSettings.EnableDiagnostics); err != nil {
|
||||
p.API.LogWarn("failed to init telemetry", "error", err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user