Skip to content

Commit

Permalink
fix: add return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrMatsko committed Dec 11, 2024
1 parent cf24dc6 commit 6ca7722
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions notifier/alive_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package notifier

import (
"context"
"fmt"
"time"

"github.com/moira-alert/moira"
Expand Down Expand Up @@ -53,9 +54,13 @@ func (watcher *AliveWatcher) stateChecker(ctx context.Context) {

func (watcher *AliveWatcher) checkNotifierState() {
state, _ := watcher.database.GetNotifierState()
fmt.Println(state)
if state != moira.SelfStateOK {
watcher.notifierMetrics.MarkNotifierIsAlive(false)
fmt.Println("Marked as not alive")
return
}

watcher.notifierMetrics.MarkNotifierIsAlive(true)
fmt.Println("Marked as alive")
}

0 comments on commit 6ca7722

Please sign in to comment.