Skip to content

Commit

Permalink
fix: nil reference while trying to shut down DB in slave mode (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Dec 16, 2022
1 parent 4e8ab75 commit 435a03d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func init() {

func main() {
// 关闭数据库连接
defer model.DB.Close()
defer func() {
if model.DB != nil {
model.DB.Close()
}
}()

if isEject {
// 开始导出内置静态资源文件
Expand Down

0 comments on commit 435a03d

Please sign in to comment.