feat: make notification delivery durable

This commit is contained in:
benya
2026-07-23 00:17:38 +03:00
parent 61b1c06205
commit 5d6fa00e94
24 changed files with 710 additions and 136 deletions

View 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)
}
}