mirror of
https://github.com/1technophile/OpenMQTTGateway.git
synced 2026-02-20 00:32:04 +01:00
[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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user