1
0

feat: set one minute delay before trying with the new rate limiter

This commit is contained in:
dump_stack() 2023-05-28 12:42:01 +00:00
parent c0914820c0
commit 8e57f7f5ef
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ var (
limiterTimeout time.Duration = time.Second / 20
limiterMaxTimeout time.Duration = time.Second
limiterBurst int = 1
limiterUpdateDelay time.Duration = time.Second * 10
limiterUpdateDelay time.Duration = time.Minute
Limiter = rate.NewLimiter(rate.Every(limiterTimeout), limiterBurst)
)
@ -37,6 +37,7 @@ func lowerLimit() {
time.Now().Add(limiterUpdateDelay),
rate.Every(limiterTimeout),
)
log.Info().Msgf("wait %v", limiterUpdateDelay)
time.Sleep(limiterUpdateDelay)
}

View File

@ -19,7 +19,7 @@ var (
limiterTimeout time.Duration = time.Second / 20
limiterMaxTimeout time.Duration = time.Second
limiterBurst int = 1
limiterUpdateDelay time.Duration = time.Second * 10
limiterUpdateDelay time.Duration = time.Minute
Limiter = rate.NewLimiter(rate.Every(limiterTimeout), limiterBurst)
)
@ -34,6 +34,7 @@ func lowerLimit() {
time.Now().Add(limiterUpdateDelay),
rate.Every(limiterTimeout),
)
log.Info().Msgf("wait %v", limiterUpdateDelay)
time.Sleep(limiterUpdateDelay)
}