fixed the limited issue
This commit is contained in:
parent
6d68430f75
commit
a142bcff58
@ -259,11 +259,11 @@ func (worker *Worker) exec(job *Job) (err error) {
|
|||||||
}
|
}
|
||||||
var result []byte
|
var result []byte
|
||||||
if worker.limit != nil {
|
if worker.limit != nil {
|
||||||
defer func() {
|
|
||||||
worker.limit <- true
|
|
||||||
}()
|
|
||||||
select {
|
select {
|
||||||
case <-worker.limit:
|
case <-worker.limit:
|
||||||
|
defer func() {
|
||||||
|
worker.limit <- true
|
||||||
|
}()
|
||||||
case <-time.After(time.Second * time.Duration(f.timeout)):
|
case <-time.After(time.Second * time.Duration(f.timeout)):
|
||||||
err = common.Errorf("The function was executed timeout: %s", funcname)
|
err = common.Errorf("The function was executed timeout: %s", funcname)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user