update example, add realtime option, fix ip limit bug for packet protocol

This commit is contained in:
yuzuki999
2023-05-17 09:46:52 +08:00
parent c6658c2ce1
commit 48da83fc3d
9 changed files with 114 additions and 100 deletions

View File

@@ -58,6 +58,7 @@ func (p *Conf) Watch(filePath string, reload func()) error {
case event := <-watcher.Events:
if event.Has(fsnotify.Write) {
log.Println("config dir changed, reloading...")
*p = *New()
err := p.LoadFromPath(filePath)
if err != nil {
log.Printf("reload config error: %s", err)