Skip to content

Commit

Permalink
Don't invalidate config when a client fails to reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
tystuyfzand committed Mar 14, 2022
1 parent 3624c44 commit 6ad97fc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func GetGotifyPluginInfo() plugin.Info {
}

type Server struct {
Address string
Username string
Password string
Address string
Username string
Password string
Subscribe []string
}

Expand All @@ -36,9 +36,9 @@ type Config struct {
type Plugin struct {
userCtx plugin.UserContext
msgHandler plugin.MessageHandler
config *Config
clients []mqtt.Client
enabled bool
config *Config
clients []mqtt.Client
enabled bool
}

// SetMessageHandler implements plugin.Messenger
Expand Down Expand Up @@ -108,7 +108,7 @@ func (p *Plugin) ValidateAndSetConfig(c interface{}) error {

// If enabled already and config was updated, reconnect clients
if p.enabled {
return p.connectClients()
p.connectClients()
}

return nil
Expand Down

0 comments on commit 6ad97fc

Please sign in to comment.