| 538 | } |
| 539 | |
| 540 | void RestServer::SetLogLimit(std::optional<unsigned int> limit) |
| 541 | { |
| 542 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 543 | m_LogLimit = limit; |
| 544 | |
| 545 | if (m_LogLimit.has_value() && m_RequestLog.size() > m_LogLimit.value()) |
| 546 | { |
| 547 | while (m_RequestLog.size() > m_LogLimit.value()) |
| 548 | { |
| 549 | m_RequestLog.pop_front(); |
| 550 | } |
| 551 | ++m_RequestLogVersion; |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | std::optional<unsigned int> RestServer::GetLogLimit() const |
| 556 | { |