free JsonDocument for livedata as soon as possible
This commit is contained in:
parent
3f8226c36c
commit
7d48e426dc
@ -61,14 +61,16 @@ void WebApiWsLiveClass::loop()
|
|||||||
if (millis() - _lastWsPublish > (10 * 1000) || (maxTimeStamp != _newestInverterTimestamp)) {
|
if (millis() - _lastWsPublish > (10 * 1000) || (maxTimeStamp != _newestInverterTimestamp)) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DynamicJsonDocument root(40960);
|
|
||||||
JsonVariant var = root;
|
|
||||||
generateJsonResponse(var);
|
|
||||||
|
|
||||||
String buffer;
|
String buffer;
|
||||||
if (buffer) {
|
// free JsonDocument as soon as possible
|
||||||
|
{
|
||||||
|
DynamicJsonDocument root(40960);
|
||||||
|
JsonVariant var = root;
|
||||||
|
generateJsonResponse(var);
|
||||||
serializeJson(root, buffer);
|
serializeJson(root, buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buffer) {
|
||||||
if (Configuration.get().Security_AllowReadonly) {
|
if (Configuration.get().Security_AllowReadonly) {
|
||||||
_ws.setAuthentication("", "");
|
_ws.setAuthentication("", "");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user