fix: nil reference while trying to shut down DB in slave mode (#1416)

This commit is contained in:
HFO4 2022-12-16 16:55:28 +08:00
parent 4e8ab75211
commit 435a03dd34

View file

@ -42,7 +42,11 @@ func init() {
func main() {
// 关闭数据库连接
defer model.DB.Close()
defer func() {
if model.DB != nil {
model.DB.Close()
}
}()
if isEject {
// 开始导出内置静态资源文件