Fixed logic error of limiterExpireTime_ (#1605)

This commit is contained in:
Muhammad 2023-05-13 18:26:13 +03:00 committed by GitHub
parent abf6f6cc86
commit 87a3132fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ void Hodor::initAndStart(const Json::Value &config)
config.get("rejection_message", "Too many requests").asString());
rejectResponse_->setCloseConnection(true);
limiterExpireTime_ =
(std::min)(static_cast<size_t>(
(std::max)(static_cast<size_t>(
config.get("limiter_expire_time", 600).asUInt()),
static_cast<size_t>(timeUnit_.count() * 3));
limitStrategies_.emplace_back(makeLimitStrategy(config));