Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions agent/app/service/cronjob_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import (
func (u *CronjobService) handleApp(cronjob model.Cronjob, startTime time.Time, taskItem *task.Task) error {
apps := loadAppsForJob(cronjob)
if len(apps) == 0 {
return errors.New("no such app in database!")
addSkipTask("App", taskItem)
return nil
}
accountMap := NewBackupClientMap(strings.Split(cronjob.SourceAccountIDs, ","))
if !accountMap[fmt.Sprintf("%d", cronjob.DownloadAccountID)].isOk {
Expand Down Expand Up @@ -83,7 +84,8 @@ func (u *CronjobService) handleApp(cronjob model.Cronjob, startTime time.Time, t
func (u *CronjobService) handleWebsite(cronjob model.Cronjob, startTime time.Time, taskItem *task.Task) error {
webs := loadWebsForJob(cronjob)
if len(webs) == 0 {
return errors.New("no such website in database!")
addSkipTask("Website", taskItem)
return nil
}
accountMap := NewBackupClientMap(strings.Split(cronjob.SourceAccountIDs, ","))
if !accountMap[fmt.Sprintf("%d", cronjob.DownloadAccountID)].isOk {
Expand Down Expand Up @@ -140,7 +142,8 @@ func (u *CronjobService) handleWebsite(cronjob model.Cronjob, startTime time.Tim
func (u *CronjobService) handleDatabase(cronjob model.Cronjob, startTime time.Time, taskItem *task.Task) error {
dbs := loadDbsForJob(cronjob)
if len(dbs) == 0 {
return errors.New("no such db in database!")
addSkipTask("Database", taskItem)
return nil
}
accountMap := NewBackupClientMap(strings.Split(cronjob.SourceAccountIDs, ","))
if !accountMap[fmt.Sprintf("%d", cronjob.DownloadAccountID)].isOk {
Expand Down Expand Up @@ -372,6 +375,13 @@ type DatabaseHelper struct {
Name string
}

func addSkipTask(source string, taskItem *task.Task) {
taskItem.AddSubTask(task.GetTaskName(i18n.GetMsgByKey(source), task.TaskBackup, task.TaskScopeCronjob), func(task *task.Task) error {
taskItem.Log(i18n.GetMsgByKey("NoSuchResource"))
return nil
}, nil)
}

func loadDbsForJob(cronjob model.Cronjob) []DatabaseHelper {
var dbs []DatabaseHelper
if cronjob.DBName == "all" {
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ IgnoreBackupErr: "Backup failed, error: {{ .detail }}, ignoring this error..."
IgnoreUploadErr: "Upload failed, error: {{ .detail }}, ignoring this error..."
LoadBackupFailed: "Failed to get backup account connection, error: {{ .detail }}"
InExecuting: "The current task is being executed, please do not repeat the execution!"
NoSuchResource: "No backup content found in the database, skipping..."

#toolbox
ErrNotExistUser: 'The current user does not exist, please modify and try again!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/ja.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ IgnoreBackupErr: "バックアップ失敗、エラー: {{ .detail }}、この
IgnoreUploadErr: "アップロード失敗、エラー: {{ .detail }}、このエラーを無視します..."
LoadBackupFailed: "バックアップアカウントの接続取得に失敗、エラー: {{ .detail }}"
InExecuting: "現在のタスクは実行中です。重複して実行しないでください!"
NoSuchResource: "データベースにバックアップ内容が見つかりませんでした。スキップします..."

#toolbox
ErrNotExistUser: '現在のユーザーは存在しません。変更してもう一度お試しください。'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ IgnoreBackupErr: "백업 실패, 오류: {{ .detail }}, 이 오류를 무시합
IgnoreUploadErr: "업로드 실패, 오류: {{ .detail }}, 이 오류를 무시합니다..."
LoadBackupFailed: "백업 계정 연결 획득 실패, 오류: {{ .detail }}"
InExecuting: "현재 작업이 실행 중입니다. 중복 실행하지 마세요!"
NoSuchResource: "데이터베이스에서 백업 내용을 찾을 수 없어 건너뜁니다..."

#도구상자
ErrNotExistUser: '현재 사용자가 존재하지 않습니다. 수정한 후 다시 시도하세요!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/ms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ IgnoreBackupErr: "Sandaran gagal, ralat: {{ .detail }}, abaikan ralat ini..."
IgnoreUploadErr: "Muat naik gagal, ralat: {{ .detail }}, abaikan ralat ini..."
LoadBackupFailed: "Gagal mendapatkan sambungan akaun sandaran, ralat: {{ .detail }}"
InExecuting: "Tugas semasa sedang dilaksanakan, jangan ulangi pelaksanaan!"
NoSuchResource: "Tiada kandungan sandaran ditemui dalam pangkalan data, dilangkau..."

#kotak alat
ErrNotExistUser: 'Pengguna semasa tidak wujud, sila ubah suai dan cuba lagi!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/pt-BR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ IgnoreBackupErr: "Backup falhou, erro: {{ .detail }}, ignorando este erro..."
IgnoreUploadErr: "Upload falhou, erro: {{ .detail }}, ignorando este erro..."
LoadBackupFailed: "Falha ao obter conexão da conta de backup, erro: {{ .detail }}"
InExecuting: "A tarefa atual está sendo executada, não repita a execução!"
NoSuchResource: "Nenhum conteúdo de backup encontrado no banco de dados, ignorando..."

#caixa de ferramentas
ErrNotExistUser: 'O usuário atual não existe, modifique e tente novamente!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/ru.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ IgnoreBackupErr: "Ошибка резервного копирования: {{ .
IgnoreUploadErr: "Ошибка загрузки: {{ .detail }}, игнорируем эту ошибку..."
LoadBackupFailed: "Не удалось получить подключение к учетной записи резервной копии, ошибка: {{ .detail }}"
InExecuting: "Текущая задача выполняется, не повторяйте выполнение!"
NoSuchResource: "В базе данных не найдено содержимое резервной копии, пропускаем..."

#ящик для инструментов
ErrNotExistUser: 'Текущий пользователь не существует, измените его и повторите попытку!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/tr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ IgnoreBackupErr: "Yedekleme başarısız, hata: {{ .detail }}, bu hata yoksayıl
IgnoreUploadErr: "Yükleme başarısız, hata: {{ .detail }}, bu hata yoksayılıyor..."
LoadBackupFailed: "Yedek hesap bağlantısı alınamadı, hata: {{ .detail }}"
InExecuting: "Mevcut görev yürütülüyor, lütfen tekrar yürütmeyin!"
NoSuchResource: "Veritabanında yedek içeriği bulunamadı, atlanıyor..."

#toolbox
ErrNotExistUser: 'Mevcut kullanıcı mevcut değil, lütfen değiştirin ve tekrar deneyin!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/zh-Hant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ IgnoreBackupErr: "備份失敗,錯誤:{{ .detail }},忽略本次錯誤..."
IgnoreUploadErr: "上傳失敗,錯誤:{{ .detail }},忽略本次錯誤..."
LoadBackupFailed: "獲取備份帳號連接失敗,錯誤:{{ .detail }}"
InExecuting: "當前任務正在執行中,請勿重複執行!"
NoSuchResource: "資料庫中未能查詢到備份內容,跳過..."

#toolbox
ErrNotExistUser: '目前使用者不存在,請修改後重試!'
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ IgnoreBackupErr: "备份失败,错误:{{ .detail }},忽略本次错误..."
IgnoreUploadErr: "上传失败,错误:{{ .detail }},忽略本次错误..."
LoadBackupFailed: "获取备份账号连接失败,错误:{{ .detail }}"
InExecuting: "当前任务正在执行中,请勿重复执行!"
NoSuchResource: "数据库中未能查询到备份内容,跳过..."

#toolbox
ErrNotExistUser: "当前用户不存在,请修改后重试!"
Expand Down
Loading