Skip to content

Commit

Permalink
Refactor internal implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexliesenfeld committed Oct 16, 2023
1 parent 5ce5741 commit 2052fce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func newChecker(cfg checkerConfig) *defaultChecker {
// Start implements Checker.Start. Please refer to Checker.Start for more information.
func (ck *defaultChecker) Start() {
ck.mtx.Lock()
defer ck.mtx.Unlock()

if !ck.started {
ctx, cancelFunc := context.WithCancel(context.Background())
Expand All @@ -185,8 +186,6 @@ func (ck *defaultChecker) Start() {
// a bad check that runs for a longer period of time.
go ck.Check(ctx)
}

ck.mtx.Unlock()
}

// Stop implements Checker.Stop. Please refer to Checker.Stop for more information.
Expand Down

0 comments on commit 2052fce

Please sign in to comment.