fix: address code review findings
This commit is contained in:
@@ -15,6 +15,9 @@ import (
|
||||
"trip-planner/internal/metrics"
|
||||
)
|
||||
|
||||
// rng is a seeded random number generator for jitter calculations.
|
||||
var rng = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
|
||||
// Client represents a Yandex Schedules API client with rate limiting,
|
||||
// circuit breaking, and retry capabilities.
|
||||
type Client struct {
|
||||
@@ -421,6 +424,5 @@ func applyJitter(backoff time.Duration) time.Duration {
|
||||
}
|
||||
|
||||
func randFloat64() float64 {
|
||||
// Use math/rand with a seed based on function call index for variability
|
||||
return rand.Float64()
|
||||
return rng.Float64()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user