完善资源关闭逻辑,添加数据库和Redis连接的退出处理
This commit is contained in:
@@ -16,3 +16,10 @@ func Init() {
|
||||
Password: env.RedisPass,
|
||||
})
|
||||
}
|
||||
|
||||
func Exit() error {
|
||||
if Client != nil {
|
||||
return Client.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user