Skip to content

Commit

Permalink
fix: alert object nil
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangliang committed Mar 18, 2022
1 parent d503c2e commit 405e8c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"strconv"
"strings"
_ "net/http/pprof"

"github.com/LilithGames/agent-go/tools/metric"
"github.com/spf13/viper"
Expand Down
3 changes: 3 additions & 0 deletions pkg/agent/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package agent

import (
"context"
"log"
"strconv"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -146,6 +147,7 @@ func (t *Tick) Tear(ticker core.Ticker) {
tick.ctx = t.ctx
tick.statPID = t.statPID
tick.actorRootContext = t.actorRootContext
tick.alert = t.alert
t.Tick.Tear(&tick.Tick)
}

Expand Down Expand Up @@ -183,6 +185,7 @@ func (t *Tick) SendAlertMsg(msg *ErrMsg) error {
if t.alert != nil {
return t.alert.SendMsg(msg)
}
log.Println("alert object is nil...")
return nil
}

Expand Down

0 comments on commit 405e8c7

Please sign in to comment.