We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
复现代码:
task := &timing2.Task{ Uuid: "uuid", Job: timing2.GetJob(func() { panic("err") }), RunTime: time.Now().Unix() + 90, }
异常代码处: job.go func (j *taskJob) run()
原因是 defer的顺序是 先进后出,原代码会先触发 j.done <- true 然后进行了 finish的逻辑,代码应改为:
defer func() { if !isPanic { j.done <- true } }() defer func() { if x := recover(); x != nil { err := errors.Errorf("job error with panic:%v", x) j.err <- err isPanic = true return } }()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
复现代码:
task := &timing2.Task{
Uuid: "uuid",
Job: timing2.GetJob(func() {
panic("err")
}),
RunTime: time.Now().Unix() + 90,
}
异常代码处:
job.go func (j *taskJob) run()
原因是 defer的顺序是 先进后出,原代码会先触发 j.done <- true 然后进行了 finish的逻辑,代码应改为:
The text was updated successfully, but these errors were encountered: