Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:28:51 +01:00
1 parent 7b6db17870
commit 0295eb1ad2
125 files changed
+59376

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package bragi
import (
"math"
"time"
"github.com/sirupsen/logrus"
)
type Source interface {
// Name returns the name of the source.
Name() string
// Events returns a channel that will be used to send events to the source.
Events() <-chan Event
}
func backoff(attempt int) {
if attempt > 0 {
delay := time.Duration(math.Pow(math.E, float64(attempt))) * time.Second
logrus.WithField("attempt", attempt).Infof("retrying in %s", delay)
time.Sleep(delay)
}
}