Skip to content

Commit

Permalink
Changing timeouts to be more reasonable in sample client
Browse files Browse the repository at this point in the history
  • Loading branch information
ridv committed Aug 27, 2016
1 parent 917bdca commit 494f733
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down Expand Up @@ -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")
}
}
Expand Down
2 changes: 1 addition & 1 deletion monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 494f733

Please sign in to comment.