Skip to content

Commit

Permalink
Move goUp() to before ShowInstances()
Browse files Browse the repository at this point in the history
  • Loading branch information
pwaller committed Jan 14, 2015
1 parent 0f1d540 commit e20583f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ func Watch(client *ec2.EC2) {
io.Copy(ioutil.Discard, os.Stdin)
}()

goUp := func() {}

for {
queryStart := time.Now()
ConfigureHTTP(true)
Expand All @@ -135,6 +137,9 @@ func Watch(client *ec2.EC2) {
ConfigureHTTP(false)

instances := InstancesFromEC2Result(ec2Instances)

goUp()

ShowInstances(instances)

queryDuration := time.Since(queryStart)
Expand All @@ -144,7 +149,7 @@ func Watch(client *ec2.EC2) {
case <-finish:
return
}
CursorUp(len(instances) + N_TABLE_DECORATIONS)
goUp = func() { CursorUp(len(instances) + N_TABLE_DECORATIONS) }
}

}
Expand Down

0 comments on commit e20583f

Please sign in to comment.