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
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
9a239a68b9
commit
fd3c744b4a
8
main.go
8
main.go
@ -138,6 +138,10 @@ func FilterJobs(jobs []Job, names []string) ([]Job, error) {
|
|||||||
func runBackupJobs(jobs []Job, names string) error {
|
func runBackupJobs(jobs []Job, names string) error {
|
||||||
namesSlice := strings.Split(names, ",")
|
namesSlice := strings.Split(names, ",")
|
||||||
|
|
||||||
|
if len(namesSlice) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
jobs, filterJobErr := FilterJobs(jobs, namesSlice)
|
jobs, filterJobErr := FilterJobs(jobs, namesSlice)
|
||||||
for _, job := range jobs {
|
for _, job := range jobs {
|
||||||
if err := job.RunBackup(); err != nil {
|
if err := job.RunBackup(); err != nil {
|
||||||
@ -151,6 +155,10 @@ func runBackupJobs(jobs []Job, names string) error {
|
|||||||
func runRestoreJobs(jobs []Job, names string) error {
|
func runRestoreJobs(jobs []Job, names string) error {
|
||||||
namesSlice := strings.Split(names, ",")
|
namesSlice := strings.Split(names, ",")
|
||||||
|
|
||||||
|
if len(namesSlice) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
jobs, filterJobErr := FilterJobs(jobs, namesSlice)
|
jobs, filterJobErr := FilterJobs(jobs, namesSlice)
|
||||||
for _, job := range jobs {
|
for _, job := range jobs {
|
||||||
if err := job.RunRestore(); err != nil {
|
if err := job.RunRestore(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user