mirror of
https://github.com/HASwitchPlate/HASPone.git
synced 2025-07-25 20:26:39 +00:00
Fix race condition in JSON config save
This commit is contained in:
parent
509e6a897a
commit
3ea99814b4
@ -2326,7 +2326,7 @@ void configSave()
|
|||||||
{ // Save the custom parameters to config.json
|
{ // Save the custom parameters to config.json
|
||||||
nextionSetAttr("p[0].b[1].txt", "\"Saving\\rconfig\"");
|
nextionSetAttr("p[0].b[1].txt", "\"Saving\\rconfig\"");
|
||||||
debugPrintln(F("SPIFFS: Saving config"));
|
debugPrintln(F("SPIFFS: Saving config"));
|
||||||
DynamicJsonDocument jsonConfigValues(1536);
|
DynamicJsonDocument jsonConfigValues(2048);
|
||||||
|
|
||||||
jsonConfigValues["mqttServer"] = mqttServer;
|
jsonConfigValues["mqttServer"] = mqttServer;
|
||||||
jsonConfigValues["mqttPort"] = mqttPort;
|
jsonConfigValues["mqttPort"] = mqttPort;
|
||||||
@ -2376,6 +2376,7 @@ void configSave()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
serializeJson(jsonConfigValues, configFile);
|
serializeJson(jsonConfigValues, configFile);
|
||||||
|
yield();
|
||||||
configFile.close();
|
configFile.close();
|
||||||
}
|
}
|
||||||
shouldSaveConfig = false;
|
shouldSaveConfig = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user