This commit is contained in:
Shikong 2022-10-04 16:17:04 +08:00
parent fbb65eac73
commit 671e6a1d54
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ import (
var App *fiber.App
func LoadApp() {
func Run() {
err := viper.Unmarshal(global.Config)
if err != nil {
logger.Log.Fatalf("配置文件解析失败: %s", err)

View File

@ -38,10 +38,10 @@ func main() {
viper.WatchConfig()
viper.OnConfigChange(func(in fsnotify.Event) {
logger.Log.Infoln(in.Name)
app.LoadApp()
app.Run()
})
app.LoadApp()
app.Run()
quit := make(chan os.Signal)
signal.Notify(quit, os.Interrupt)