add: 提交

This commit is contained in:
lichang
2023-08-14 17:02:50 +08:00
parent 897d45d443
commit 5ac2e981ea
163 changed files with 29466 additions and 0 deletions

32
crontask/config_linux.go Normal file
View File

@@ -0,0 +1,32 @@
//go:build linux
// +build linux
package main
import (
"os"
"os/signal"
"syscall"
"ems.agt/lib/log"
)
// 启动一个 goroutine 监听信号量
func ReloadRoutine() {
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGUSR1)
for {
<-sigCh
log.Info("Received reload signal, reloading config...")
err := ReadConfig(*ConfigFile)
if err != nil {
log.Error("Failed to ReadConfig:", err)
continue
}
log.Info("Config reloaded successfully.")
}
}