refactor: code review

This commit is contained in:
meilin.huang
2024-01-09 17:31:21 +08:00
parent 3c89a285f5
commit b7aa281611
15 changed files with 130 additions and 60 deletions

View File

@@ -0,0 +1,25 @@
package initialize
import (
dbApp "mayfly-go/internal/db/application"
)
// 终止服务后的一些操作
func Terminate() {
closeDbTasks()
}
func closeDbTasks() {
restoreApp := dbApp.GetDbRestoreApp()
if restoreApp != nil {
restoreApp.Close()
}
binlogApp := dbApp.GetDbBinlogApp()
if binlogApp != nil {
binlogApp.Close()
}
backupApp := dbApp.GetDbBackupApp()
if backupApp != nil {
backupApp.Close()
}
}