From 7c1ecfa89c3105ead6621620dc3b996de8cc2057 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Wed, 16 Feb 2022 17:56:22 +0700 Subject: [PATCH] [Update] Change name config in struct --- instance.go | 4 ++-- task.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instance.go b/instance.go index d8b93ad..08104f0 100644 --- a/instance.go +++ b/instance.go @@ -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 diff --git a/task.go b/task.go index 03c15cc..966bf66 100644 --- a/task.go +++ b/task.go @@ -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