mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2025-04-09 03:21:02 +02:00
32 lines
396 B
Go
32 lines
396 B
Go
package client
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/hibiken/asynq"
|
|
)
|
|
|
|
type JobType string
|
|
|
|
var (
|
|
defaultRetentionPeriod = 24 * 2 * time.Hour
|
|
)
|
|
|
|
type Opts struct {
|
|
RedisDSN string
|
|
}
|
|
|
|
type TaskerClient struct {
|
|
Client *asynq.Client
|
|
}
|
|
|
|
func NewTaskerClient(o Opts) *TaskerClient {
|
|
client := asynq.NewClient(asynq.RedisClientOpt{
|
|
Addr: o.RedisDSN,
|
|
})
|
|
|
|
return &TaskerClient{
|
|
Client: client,
|
|
}
|
|
}
|