完善资源关闭逻辑,添加数据库和Redis连接的退出处理

This commit is contained in:
2025-04-01 11:26:37 +08:00
parent 6d89470a89
commit 87eecdb8cb
7 changed files with 74 additions and 50 deletions

View File

@@ -16,3 +16,10 @@ func Init() {
Password: env.RedisPass,
})
}
func Exit() error {
if Client != nil {
return Client.Close()
}
return nil
}