Commit 028ed8ee authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge pull request #2302 from mslipper/bugfix/proxyd-zero-oos-interval

proxyd: Don't hit Redis when the out of service interval is zero
parents 3525635a ae18cea1
---
'@eth-optimism/proxyd': patch
---
Don't hit Redis when the out of service interval is zero
...@@ -85,6 +85,9 @@ func (r *RedisRateLimiter) IsBackendOnline(name string) (bool, error) { ...@@ -85,6 +85,9 @@ func (r *RedisRateLimiter) IsBackendOnline(name string) (bool, error) {
} }
func (r *RedisRateLimiter) SetBackendOffline(name string, duration time.Duration) error { func (r *RedisRateLimiter) SetBackendOffline(name string, duration time.Duration) error {
if duration == 0 {
return nil
}
err := r.rdb.SetEX( err := r.rdb.SetEX(
context.Background(), context.Background(),
fmt.Sprintf("backend:%s:offline", name), fmt.Sprintf("backend:%s:offline", name),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment