[Update] Change name config in struct

This commit is contained in:
trunglt251292 2022-02-16 17:56:22 +07:00
parent 1e8c775bb6
commit 7c1ecfa89c
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ type Instance struct {
Server *asynq.ServeMux
Scheduler *asynq.Scheduler
Configs Config
Config Config
}
var instance Instance
@ -31,7 +31,7 @@ func NewInstance(cfg Config) Instance {
instance.Server = initServer(redisConn, cfg)
instance.Scheduler = initScheduler(redisConn)
instance.Client = initClient(redisConn)
instance.Configs = cfg
instance.Config = cfg
// Return instance
return instance

View File

@ -28,8 +28,8 @@ func (i Instance) RunTask(typename string, payload []byte, priority string, retr
options = append(options, asynq.MaxRetry(retryTimes))
// Task timeout
if i.Configs.TaskTimeout != 0 {
options = append(options, asynq.Timeout(i.Configs.TaskTimeout))
if i.Config.TaskTimeout != 0 {
options = append(options, asynq.Timeout(i.Config.TaskTimeout))
}
// Enqueue task