Skip to content

Commit

Permalink
check log_buffer before expanding
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Dec 23, 2022
1 parent b9b79bb commit 1b956c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/web/WebLogService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ size_t WebLogService::maximum_log_messages() const {
}

void WebLogService::maximum_log_messages(size_t count) {
if (count > maximum_log_messages_ && ESP.getMaxAllocHeap() < 41984) {
return;
}
maximum_log_messages_ = std::max((size_t)1, count);
while (log_messages_.size() > maximum_log_messages_) {
log_messages_.pop_front();
Expand Down

0 comments on commit 1b956c6

Please sign in to comment.