accounting: add call to clear stats
- Make calls more consistent by changing path to kebab case. - Add stacktrace information to job panics
This commit is contained in:
committed by
Nick Craig-Wood
parent
5be968c0ca
commit
6a3e301303
+2
-1
@@ -5,6 +5,7 @@ package jobs
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -126,7 +127,7 @@ func (job *Job) finish(out rc.Params, err error) {
|
||||
func (job *Job) run(ctx context.Context, fn rc.Func, in rc.Params) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
job.finish(nil, errors.Errorf("panic received: %v", r))
|
||||
job.finish(nil, errors.Errorf("panic received: %v \n%s", r, string(debug.Stack())))
|
||||
}
|
||||
}()
|
||||
job.finish(fn(ctx, in))
|
||||
|
||||
Reference in New Issue
Block a user