diff --git a/examples/client.go b/examples/client.go index 74f40fc..6dd9a0f 100644 --- a/examples/client.go +++ b/examples/client.go @@ -125,7 +125,7 @@ func main() { fmt.Println(resp.String()) if(resp.ResponseCode == aurora.ResponseCode_OK) { - if(!monitor.Instances(job.JobKey(), job.GetInstanceCount(), 5, 10)) { + if(!monitor.Instances(job.JobKey(), job.GetInstanceCount(), 5, 50)) { _, err := r.KillJob(job.JobKey()) if err != nil { fmt.Println(err) @@ -144,7 +144,7 @@ func main() { } if(resp.ResponseCode == aurora.ResponseCode_OK) { - if(!monitor.Instances(job.JobKey(), 0, 5, 10)) { + if(!monitor.Instances(job.JobKey(), 0, 5, 50)) { fmt.Println("Unable to kill all instances of job") os.Exit(1) } @@ -194,7 +194,7 @@ func main() { } if(resp.ResponseCode == aurora.ResponseCode_OK) { - if(!monitor.Instances(job.JobKey(), job.GetInstanceCount()+numOfInstances, 5, 10)) { + if(!monitor.Instances(job.JobKey(), job.GetInstanceCount()+numOfInstances, 5, 50)) { fmt.Println("Flexing up failed") } } diff --git a/monitors.go b/monitors.go index 4abcf3c..d44a4cf 100644 --- a/monitors.go +++ b/monitors.go @@ -65,7 +65,7 @@ func (m *Monitor) JobUpdate(updateKey aurora.JobUpdateKey, interval int, timeout func (m *Monitor) Instances(key *aurora.JobKey, instances int32, interval int, timeout int) bool { - for i := 0; i*interval <= timeout; i++ { + for i := 0; i*interval < timeout; i++ { live, err := m.Client.GetInstanceIds(key, aurora.LIVE_STATES)