Skip to content

Commit

Permalink
modify backup.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jxr98 committed Sep 23, 2021
1 parent 53901fd commit 92e4afb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ func (o *BackupOption) Backup(cmd *cobra.Command, _ []string) (err error) {
cmd.Println("Backup failed. Please see logging message(yourJenkinsHome/backup.log) for detailed reasons.")
return err
}
i := 0
for o.WaitTime-i*15 > 0 && o.CheckBackup {
for i := 0; o.WaitTime-i*15 > 0 && o.CheckBackup; i++ {
time.Sleep(15 * time.Second)
stat, err := os.Stat(o.BackupDir)
if err == nil {
Expand All @@ -80,7 +79,6 @@ func (o *BackupOption) Backup(cmd *cobra.Command, _ []string) (err error) {
}
}
}
i++
}
if !o.CheckBackup {
cmd.Println("Trigger thinBackup plugin to backup successfully, please check the backup directory to make sure the backup succeeds or thinBackup is waiting jenkins to be idle.")
Expand Down

0 comments on commit 92e4afb

Please sign in to comment.