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
|
// outputing loop
|
||||||
func (a *agent) outLoop() {
|
func (a *agent) outLoop() {
|
||||||
ok := true
|
ok := true
|
||||||
|
var job *Job
|
||||||
for ok {
|
for ok {
|
||||||
if job, ok := <-a.out; ok {
|
if job, ok = <-a.out; ok {
|
||||||
if err := a.write(job.Encode()); err != nil {
|
if err := a.write(job.Encode()); err != nil {
|
||||||
a.worker.err(err)
|
a.worker.err(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user