Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code refactor notify #1066

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions etc/script/notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ import (
"github.com/tidwall/gjson"
)

// the caller can be called for alerting notify by complete this interface
type inter interface {
Descript() string
Notify([]byte)
NotifyMaintainer([]byte)
}

// N9E complete
type N9EPlugin struct {
Name string
Expand Down Expand Up @@ -48,6 +41,6 @@ func (n *N9EPlugin) NotifyMaintainer(bs []byte) {
// will be loaded for alertingCall , The first letter must be capitalized to be exported
var N9eCaller = N9EPlugin{
Name: "N9EPlugin",
Description: "Notification by lib",
Description: "Notify by lib",
BuildAt: time.Now().Local().Format("2006/01/02 15:04:05"),
}
6 changes: 0 additions & 6 deletions src/server/engine/notify_maintainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package engine

import (
"encoding/json"
"runtime"
"time"

"github.com/didi/nightingale/v5/src/models"
Expand All @@ -25,11 +24,6 @@ func notifyMaintainerWithPlugin(e error, title, triggerTime string, users []*mod
return
}

if runtime.GOOS == "windows" {
logger.Errorf("call notify plugin on unsupported os: %s", runtime.GOOS)
return
}

stdinBytes, err := json.Marshal(MaintainMessage{
Tos: users,
Title: title,
Expand Down