[SYS] Avoid queue overloading at start (#2114)

Give one cycle of the loop without starting BT

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
Florian
2024-11-15 10:37:20 -06:00
committed by GitHub
parent 8bad846d94
commit 1f45a7711b

View File

@@ -69,7 +69,7 @@ bool firstStart = true;
#define ARDUINOJSON_ENABLE_STD_STRING 1
#include <queue>
int queueLength = 0;
int queueLength = -1; // We want to give one cycle of the loop before starting modules that are big msgs producers (example BT), to avoid queue overloading
unsigned long queueLengthSum = 0;
unsigned long blockedMessages = 0;
unsigned long receivedMessages = 0;
@@ -522,7 +522,7 @@ void emptyQueue() {
if (queueLength > maxQueueLength) {
maxQueueLength = queueLength;
}
if (queueLength == 0) {
if (queueLength <= 0) {
return;
}
Log.trace(F("Dequeue JSON" CR));