mirror of https://github.com/statping/statping
notifications
parent
ce6adc9d1c
commit
5f95b72744
|
@ -278,11 +278,11 @@ CheckNotifier:
|
||||||
ok, _ := notification.WithinLimits()
|
ok, _ := notification.WithinLimits()
|
||||||
if ok {
|
if ok {
|
||||||
msg := notification.Queue[0]
|
msg := notification.Queue[0]
|
||||||
err := n.Send(msg)
|
err := n.Send(msg.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Log(2, fmt.Sprintf("notifier %v had an error: %v", notification.Method, err))
|
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:]
|
notification.Queue = notification.Queue[1:]
|
||||||
rateLimit = notification.Delay
|
rateLimit = notification.Delay
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ func (u *mobilePush) OnTest() error {
|
||||||
return nil
|
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 {
|
func (u *mobilePush) Send(msg interface{}) error {
|
||||||
pushMessage := msg.(*expo.PushMessage)
|
pushMessage := msg.(*expo.PushMessage)
|
||||||
client := expo.NewPushClient(nil)
|
client := expo.NewPushClient(nil)
|
||||||
|
|
|
@ -106,12 +106,6 @@ func TestMobileNotifier(t *testing.T) {
|
||||||
assert.True(t, ok)
|
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) {
|
t.Run("mobile Test", func(t *testing.T) {
|
||||||
err := mobile.OnTest()
|
err := mobile.OnTest()
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
Loading…
Reference in New Issue