feat: make notification delivery durable
This commit is contained in:
18
server/internal/httpapi/notifications_internal_test.go
Normal file
18
server/internal/httpapi/notifications_internal_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package httpapi
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestNotificationRetryDelay(t *testing.T) {
|
||||
want := []time.Duration{30 * time.Second, time.Minute, 2 * time.Minute, 4 * time.Minute, 8 * time.Minute}
|
||||
for index, expected := range want {
|
||||
if got := notificationRetryDelay(index + 1); got != expected {
|
||||
t.Fatalf("attempt %d: got %s want %s", index+1, got, expected)
|
||||
}
|
||||
}
|
||||
if got := notificationRetryDelay(20); got != 30*time.Minute {
|
||||
t.Fatalf("retry cap: got %s want 30m", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user