summaryrefslogtreecommitdiff
path: root/swift/common/middleware/backend_ratelimit.py
diff options
context:
space:
mode:
Diffstat (limited to 'swift/common/middleware/backend_ratelimit.py')
-rw-r--r--swift/common/middleware/backend_ratelimit.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/swift/common/middleware/backend_ratelimit.py b/swift/common/middleware/backend_ratelimit.py
index 980e9edc4..75e6e9741 100644
--- a/swift/common/middleware/backend_ratelimit.py
+++ b/swift/common/middleware/backend_ratelimit.py
@@ -66,13 +66,14 @@ class BackendRateLimitMiddleware(object):
try:
device, partition, _ = split_and_validate_path(req, 1, 3, True)
int(partition) # check it's a valid partition
+ except Exception: # noqa
+ # request may not have device/partition e.g. a healthcheck req
+ pass
+ else:
rate_limiter = self.rate_limiters[device]
if not rate_limiter.is_allowed():
self.logger.increment('backend.ratelimit')
handler = HTTPTooManyBackendRequests()
- except Exception: # noqa
- # request may not have device/partition e.g. a healthcheck req
- pass
return handler(env, start_response)