fix: Fix fatabase backup cronjobimport failures (#9731)

This commit is contained in:
ssongliu 2025-07-29 16:03:55 +08:00 committed by GitHub
parent bf9a9bf17a
commit 4565c5b300
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -266,7 +266,7 @@ func (u *CronjobService) Import(req []dto.CronjobTrans) error {
break
}
var dbIDs []string
if cronjob.DBType == "postgresql" {
if strings.Contains(cronjob.DBType, "postgresql") {
for _, db := range item.DBNames {
dbItem, err := postgresqlRepo.Get(postgresqlRepo.WithByPostgresqlName(db.Name), repo.WithByName(db.DetailName))
if err != nil {
@ -323,6 +323,7 @@ func (u *CronjobService) Import(req []dto.CronjobTrans) error {
hasNotFound = true
break
}
cronjob.SourceDir = item.SourceDir
} else {
fileList := strings.Split(item.SourceDir, ",")
var newFiles []string