perf(tasker): update retry strategy

* closes #20
This commit is contained in:
Mohamed Sohail 2022-10-25 14:58:16 +00:00
parent eba725fbcd
commit 6713f0f3ae
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D

View File

@ -1,6 +1,8 @@
package server
import (
"time"
"github.com/grassrootseconomics/cic-custodial/internal/actions"
tasker_client "github.com/grassrootseconomics/cic-custodial/internal/tasker/client"
"github.com/hibiken/asynq"
@ -38,6 +40,13 @@ func NewTaskerServer(o Opts) *TaskerServer {
asynq.Config{
Concurrency: o.Concurrency,
Logger: asynqCompatibleLogger(o.Logger),
RetryDelayFunc: func(n int, e error, t *asynq.Task) time.Duration {
if n < 6 {
return 1 * time.Second
} else {
return asynq.DefaultRetryDelayFunc(n, e, t)
}
},
},
)