fixed the infinite loop issue
This commit is contained in:
parent
16f134a30a
commit
d2301626cd
@ -36,8 +36,9 @@ func newAgent(addr string, worker *Worker) (a *agent, err error) {
|
||||
// outputing loop
|
||||
func (a *agent) outLoop() {
|
||||
ok := true
|
||||
var job *Job
|
||||
for ok {
|
||||
if job, ok := <-a.out; ok {
|
||||
if job, ok = <-a.out; ok {
|
||||
if err := a.write(job.Encode()); err != nil {
|
||||
a.worker.err(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user