mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2025-01-04 10:46:02 +00:00
Log amount of loaded rules on reload
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
6a03840592
commit
d1e63f0c2b
2 changed files with 8 additions and 4 deletions
|
@ -24,8 +24,8 @@ type configFile struct {
|
||||||
rawLogWriter io.WriteCloser
|
rawLogWriter io.WriteCloser
|
||||||
}
|
}
|
||||||
|
|
||||||
func newConfigFile() configFile {
|
func newConfigFile() *configFile {
|
||||||
return configFile{
|
return &configFile{
|
||||||
PermitTimeout: time.Minute,
|
PermitTimeout: time.Minute,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ func loadConfig(filename string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
config = &tmpConfig
|
config = tmpConfig
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
main.go
6
main.go
|
@ -127,7 +127,11 @@ func main() {
|
||||||
|
|
||||||
irc.ExecuteJoins(config.Channels)
|
irc.ExecuteJoins(config.Channels)
|
||||||
|
|
||||||
log.Info("Config file reloaded")
|
log.WithFields(log.Fields{
|
||||||
|
"auto_messages": len(config.AutoMessages),
|
||||||
|
"rules": len(config.Rules),
|
||||||
|
"channels": len(config.Channels),
|
||||||
|
}).Info("Config file reloaded")
|
||||||
|
|
||||||
case <-autoMessageTicker.C:
|
case <-autoMessageTicker.C:
|
||||||
configLock.RLock()
|
configLock.RLock()
|
||||||
|
|
Loading…
Reference in a new issue