4
2020/12/18 10:29:01.271 [W] init global config instance failed. If you donot use this, just ignore it. open conf/app.conf: no such file or directory
./beego2project flag redefined: graceful
panic: ./beego2project flag redefined: graceful
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc000132120, 0x1d428e0, 0x24b160f, 0x1bc108f, 0x8, 0x1bdb0ed, 0x21)
/usr/local/go/src/flag/flag.go:851 +0x4b8
flag.BoolVar(...)
/usr/local/go/src/flag/flag.go:630
github.com/beego/beego/v2/server/web/grace.init.0()
/Users/c/workdir/beego2project/vendor/github.com/beego/beego/v2/server/web/grace/grace.go:93 +0x7a
重新指定另外一个配置路径 比如根目录下配置一个 configs 目录,并且 web.Run() 调用之前, load configs/app.conf 配置,开启 graceful = true 将导致,项目无法启动。 beego2 貌似必须加载 conf/app.conf 作为配置。