From a142bcff58ff5bb6c1a1470993aa6a71d4de2e6a Mon Sep 17 00:00:00 2001 From: mikespook Date: Mon, 4 Jun 2012 16:34:29 +0800 Subject: [PATCH] fixed the limited issue --- worker/worker.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/worker.go b/worker/worker.go index 588e475..3c64f93 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -259,11 +259,11 @@ func (worker *Worker) exec(job *Job) (err error) { } var result []byte if worker.limit != nil { - defer func() { - worker.limit <- true - }() select { case <-worker.limit: + defer func() { + worker.limit <- true + }() case <-time.After(time.Second * time.Duration(f.timeout)): err = common.Errorf("The function was executed timeout: %s", funcname) }