agent: Handle cancel for idle wait

This commit is contained in:
Armon Dadgar 2014-09-01 13:13:15 -07:00
parent bfb2b93d75
commit 3286074758
1 changed files with 5 additions and 1 deletions

View File

@ -220,7 +220,11 @@ WAIT:
}
case <-time.After(spec.Wait):
// Acts like a heartbeat, since there is no output
a.remoteExecWriteOutput(&event, num, nil)
if !a.remoteExecWriteOutput(&event, num, nil) {
close(writer.CancelCh)
exitCode = 255
return
}
}
}