update
parent
df985a3000
commit
7d1e0b7a7b
|
@ -7,6 +7,7 @@ import (
|
||||||
cron "github.com/robfig/cron/v3"
|
cron "github.com/robfig/cron/v3"
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
"kumoly.io/kumoly/app/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
var l zerolog.Logger
|
var l zerolog.Logger
|
||||||
|
@ -60,7 +61,10 @@ func (t *_task) Run() {
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := recover(); err != nil {
|
if err := recover(); err != nil {
|
||||||
l.Error().Str("error", fmt.Sprint(err)).Msg("")
|
l.Error().Str("task_id", t.Task.ID).
|
||||||
|
Str("task_name", t.name).Str("trace", util.Stack()).
|
||||||
|
Str("error", fmt.Sprint(err)).Msg("task paniced")
|
||||||
|
|
||||||
} else if t.once {
|
} else if t.once {
|
||||||
c.Remove(t.id)
|
c.Remove(t.id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue