mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 11:52:24 -05:00 
			
		
		
		
	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:
		
					parent
					
						
							
								457ca3c9d3
							
						
					
				
			
			
				commit
				
					
						436765a6a2
					
				
			
		
					 31 changed files with 500 additions and 167 deletions
				
			
		
							
								
								
									
										26
									
								
								vendor/github.com/minio/minio-go/v7/retry-continous.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								vendor/github.com/minio/minio-go/v7/retry-continous.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -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 | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue