bump dependencies: minio-go, go-sqlite3, goldmark, otel, x/image/webp (#4075)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4075
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
kim
2025-04-28 11:20:24 +00:00
committed by kim
parent 457ca3c9d3
commit 436765a6a2
31 changed files with 500 additions and 167 deletions

View File

@ -17,12 +17,14 @@
package minio
import "time"
import (
"iter"
"math"
"time"
)
// newRetryTimerContinous creates a timer with exponentially increasing delays forever.
func (c *Client) newRetryTimerContinous(baseSleep, maxSleep time.Duration, jitter float64, doneCh chan struct{}) <-chan int {
attemptCh := make(chan int)
func (c *Client) newRetryTimerContinous(baseSleep, maxSleep time.Duration, jitter float64) iter.Seq[int] {
// normalize jitter to the range [0, 1.0]
if jitter < NoJitter {
jitter = NoJitter
@ -44,26 +46,20 @@ func (c *Client) newRetryTimerContinous(baseSleep, maxSleep time.Duration, jitte
if sleep > maxSleep {
sleep = maxSleep
}
if jitter != NoJitter {
if math.Abs(jitter-NoJitter) > 1e-9 {
sleep -= time.Duration(c.random.Float64() * float64(sleep) * jitter)
}
return sleep
}
go func() {
defer close(attemptCh)
return func(yield func(int) bool) {
var nextBackoff int
for {
select {
// Attempts starts.
case attemptCh <- nextBackoff:
nextBackoff++
case <-doneCh:
// Stop the routine.
if !yield(nextBackoff) {
return
}
nextBackoff++
time.Sleep(exponentialBackoffWait(nextBackoff))
}
}()
return attemptCh
}
}