Skip to content

Commit

Permalink
修改
Browse files Browse the repository at this point in the history
  • Loading branch information
liqi committed Sep 26, 2023
1 parent 1932cb4 commit 0dcd6e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/stores/mon/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
10 changes: 5 additions & 5 deletions core/stores/mon/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}

0 comments on commit 0dcd6e2

Please sign in to comment.