From a2ea097be082af9f5b62079c05b27ef3ae466963 Mon Sep 17 00:00:00 2001 From: liqi <419822933@qq.com> Date: Tue, 26 Sep 2023 12:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/stores/mon/model.go | 2 +- core/stores/mon/options.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/stores/mon/model.go b/core/stores/mon/model.go index 8dc2bd02cc61b..80eccbf4e0136 100644 --- a/core/stores/mon/model.go +++ b/core/stores/mon/model.go @@ -54,7 +54,7 @@ func NewModel(uri, db, collection string, opts ...Option) (*Model, error) { if withBreaker != nil { brk = withBreaker.(breaker.Breaker) } - if withOutBreaker != nil { + if withoutBreaker != nil { breaker.NoBreakerFor(uri) } diff --git a/core/stores/mon/options.go b/core/stores/mon/options.go index ffab6d4c2d172..1f569e5b73e68 100644 --- a/core/stores/mon/options.go +++ b/core/stores/mon/options.go @@ -13,7 +13,7 @@ const defaultTimeout = time.Second * 3 var slowThreshold = syncx.ForAtomicDuration(defaultSlowThreshold) var withBreaker any -var withOutBreaker any +var withoutBreaker any type ( options = mopt.ClientOptions @@ -40,16 +40,16 @@ func WithTimeout(timeout time.Duration) Option { } } -// WithOutBreaker not use breaker. -func WithOutBreaker() Option { +// WithoutBreaker not use breaker. +func WithoutBreaker() Option { return func(opts *options) { - withOutBreaker = struct{}{} + withoutBreaker = struct{}{} } } // WithBreaker use customer breaker. func WithBreaker(brk breaker.Breaker) Option { return func(opts *options) { - withOutBreaker = brk + withBreaker = brk } }