Fix bug where command would always fail due to lack of one off jobs specified
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
IamTheFij 2022-11-10 13:04:18 -08:00
parent 9a239a68b9
commit fd3c744b4a

View File

@ -138,6 +138,10 @@ func FilterJobs(jobs []Job, names []string) ([]Job, error) {
func runBackupJobs(jobs []Job, names string) error {
namesSlice := strings.Split(names, ",")
if len(namesSlice) == 0 {
return nil
}
jobs, filterJobErr := FilterJobs(jobs, namesSlice)
for _, job := range jobs {
if err := job.RunBackup(); err != nil {
@ -151,6 +155,10 @@ func runBackupJobs(jobs []Job, names string) error {
func runRestoreJobs(jobs []Job, names string) error {
namesSlice := strings.Split(names, ",")
if len(namesSlice) == 0 {
return nil
}
jobs, filterJobErr := FilterJobs(jobs, namesSlice)
for _, job := range jobs {
if err := job.RunRestore(); err != nil {