monitor job update returns on Rolle back and update fail
This commit is contained in:
parent
7e578f80bd
commit
dcab5e698f
1 changed files with 11 additions and 1 deletions
12
monitors.go
12
monitors.go
|
@ -24,6 +24,11 @@ import (
|
|||
"github.com/rdelval/gorealis/response"
|
||||
)
|
||||
|
||||
const (
|
||||
UpdateFailed = "update failed"
|
||||
RolledBack = "update rolled back"
|
||||
)
|
||||
|
||||
type Monitor struct {
|
||||
Client Realis
|
||||
}
|
||||
|
@ -82,7 +87,12 @@ func (m *Monitor) JobUpdate(updateKey aurora.JobUpdateKey, interval int, timeout
|
|||
return true, nil
|
||||
} else if status == aurora.JobUpdateStatus_FAILED {
|
||||
fmt.Println("Update failed")
|
||||
return false, errors.New("update failed")
|
||||
return false, errors.New(UpdateFailed)
|
||||
} else if status == aurora.JobUpdateStatus_ROLLED_BACK {
|
||||
fmt.Println("rolled back")
|
||||
return false, errors.New(RolledBack)
|
||||
} else {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue