fix: Fix the problem of unfiltered types in the backup database of cr… (#8896)

…onjob
This commit is contained in:
ssongliu 2025-06-03 17:12:48 +08:00 committed by GitHub
parent a9e8c79e09
commit a7ec06e066
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -309,12 +309,13 @@ func loadDbsForJob(cronjob model.Cronjob) []DatabaseHelper {
var dbs []DatabaseHelper
if cronjob.DBName == "all" {
if cronjob.DBType == "mysql" || cronjob.DBType == "mariadb" {
mysqlItems, _ := mysqlRepo.List()
databaseService := NewIDatabaseService()
mysqlItems, _ := databaseService.LoadItems(cronjob.DBType)
for _, mysql := range mysqlItems {
dbs = append(dbs, DatabaseHelper{
ID: mysql.ID,
DBType: cronjob.DBType,
Database: mysql.MysqlName,
Database: mysql.Name,
Name: mysql.Name,
})
}