From d9484e28ca531cdefd4a1dfdc2f0d2bcf2d6bb32 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Sat, 26 Mar 2022 06:24:03 +0700 Subject: [PATCH] fix --- appier.go | 5 ++++- config.go | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/appier.go b/appier.go index 519e141..e3cd4c6 100644 --- a/appier.go +++ b/appier.go @@ -42,7 +42,10 @@ func NewClient(config Config) (*Client, error) { } // Init schedule - initSchedule() + if config.IsScheduled { + initSchedule() + } + return client, nil } diff --git a/config.go b/config.go index 8ab5f95..ad11f9f 100644 --- a/config.go +++ b/config.go @@ -4,6 +4,7 @@ import "github.com/Selly-Modules/natsio" // Config ... type Config struct { - Redis RedisCfg - Nats natsio.Config + Redis RedisCfg + Nats natsio.Config + IsScheduled bool } -- 2.34.1