mirror of https://github.com/statping/statping
notifications
parent
ce6adc9d1c
commit
5f95b72744
|
@ -278,11 +278,11 @@ CheckNotifier:
|
|||
ok, _ := notification.WithinLimits()
|
||||
if ok {
|
||||
msg := notification.Queue[0]
|
||||
err := n.Send(msg)
|
||||
err := n.Send(msg.Data)
|
||||
if err != nil {
|
||||
utils.Log(2, fmt.Sprintf("notifier %v had an error: %v", notification.Method, err))
|
||||
}
|
||||
notification.makeLog(msg)
|
||||
notification.makeLog(msg.Data)
|
||||
notification.Queue = notification.Queue[1:]
|
||||
rateLimit = notification.Delay
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ func (u *mobilePush) OnTest() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Send will send a HTTP Post to the discord API. It accepts type: []byte
|
||||
// Send will send message to expo mobile push notifications endpoint
|
||||
func (u *mobilePush) Send(msg interface{}) error {
|
||||
pushMessage := msg.(*expo.PushMessage)
|
||||
client := expo.NewPushClient(nil)
|
||||
|
|
|
@ -106,12 +106,6 @@ func TestMobileNotifier(t *testing.T) {
|
|||
assert.True(t, ok)
|
||||
})
|
||||
|
||||
t.Run("mobile Send", func(t *testing.T) {
|
||||
err := mobile.Send(slackTestMessage)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 0, len(mobile.Queue))
|
||||
})
|
||||
|
||||
t.Run("mobile Test", func(t *testing.T) {
|
||||
err := mobile.OnTest()
|
||||
assert.Nil(t, err)
|
||||
|
|
Loading…
Reference in New Issue