Start working loop first

This commit is contained in:
mikespook 2013-01-11 11:33:13 +08:00
parent ab0fc4a6a5
commit aa9b5e9598

View File

@ -190,13 +190,13 @@ func (worker *Worker) Work() {
v.Close() v.Close()
} }
}() }()
for funcname, f := range worker.funcs {
worker.addFunc(funcname, f.timeout)
}
worker.running = true worker.running = true
for _, v := range worker.agents { for _, v := range worker.agents {
go v.Work() go v.Work()
} }
for funcname, f := range worker.funcs {
worker.addFunc(funcname, f.timeout)
}
ok := true ok := true
for ok { for ok {
var job *Job var job *Job