fix: nil reference while trying to shut down DB in slave mode (#1416)
This commit is contained in:
parent
4e8ab75211
commit
435a03dd34
1 changed files with 5 additions and 1 deletions
6
main.go
6
main.go
|
@ -42,7 +42,11 @@ func init() {
|
|||
|
||||
func main() {
|
||||
// 关闭数据库连接
|
||||
defer model.DB.Close()
|
||||
defer func() {
|
||||
if model.DB != nil {
|
||||
model.DB.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
if isEject {
|
||||
// 开始导出内置静态资源文件
|
||||
|
|
Loading…
Add table
Reference in a new issue