17 lines
376 B
Go
Executable File
17 lines
376 B
Go
Executable File
package errhandler
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.wishpal.cn/wishpal_ironfan/xframe/component/logger"
|
|
"github.com/hibiken/asynq"
|
|
)
|
|
|
|
type ErrorHandler struct {
|
|
}
|
|
|
|
func (h ErrorHandler) HandleError(ctx context.Context, task *asynq.Task, err error) {
|
|
logger.WithContext(ctx).Errorf("asynq task failed, task type: %s, payload: %s, error: %v", task.Type(),
|
|
task.Payload(), err)
|
|
}
|