Skip to content

Commit

Permalink
Alertingfix (#348)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominic Wong <[email protected]>
  • Loading branch information
crufter and Dominic Wong authored Sep 16, 2020
1 parent cf0ef6c commit 43a9d7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion alert/handler/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func NewAlert(store store.Store) *Alert {
if len(gaPropertyID) == 0 {
log.Errorf("Google Analytics key (property ID) is missing")
}
log.Infof("Slack enabled: %v", slackEnabled)

return &Alert{
slackClient: slack.New(slackToken),
Expand Down Expand Up @@ -84,7 +85,7 @@ func (e *Alert) ReportEvent(ctx context.Context, req *alert.ReportEventRequest,
if err != nil {
return err
}
msg := fmt.Sprintf("Error event received:\n```\n%v\n```", string(jsond))
msg := fmt.Sprintf("Event received:\n```\n%v\n```", string(jsond))
_, _, _, err = e.slackClient.SendMessage("errors", slack.MsgOptionUsername("Alert Service"), slack.MsgOptionText(msg, false))
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions signup/handler/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ func (e *Signup) verify(ctx context.Context, req *signup.VerifyRequest, rsp *sig
func (e *Signup) CompleteSignup(ctx context.Context, req *signup.CompleteSignupRequest, rsp *signup.CompleteSignupResponse) error {
err := e.completeSignup(ctx, req, rsp)
val := 0
label := "Completed signup"
if err == nil {
label := fmt.Sprintf("Successful signup: %v", req.Email)
if err != nil {
val = 1
label = fmt.Sprintf("Error for %v: %v", req.Email, err)
}
Expand Down

0 comments on commit 43a9d7f

Please sign in to comment.