mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
[Task Settings Cache] Fix save taskValueNames on ESP32
In some situations, the newly set task value names were not saved due to a cache race condition.
This commit is contained in:
@@ -1997,5 +1997,4 @@ void setBasicTaskValues(taskIndex_t taskIndex, unsigned long taskdevicetimer,
|
||||
Settings.TaskDevicePin1[taskIndex] = pin1;
|
||||
Settings.TaskDevicePin2[taskIndex] = pin2;
|
||||
Settings.TaskDevicePin3[taskIndex] = pin3;
|
||||
SaveTaskSettings(taskIndex);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ void taskClear(taskIndex_t taskIndex, bool save)
|
||||
checkRAM(F("taskClear"));
|
||||
#endif // ifndef BUILD_NO_RAM_TRACKER
|
||||
Settings.clearTask(taskIndex);
|
||||
Cache.clearTaskCaches();
|
||||
ExtraTaskSettings.clear(); // Invalidate any cached values.
|
||||
ExtraTaskSettings.TaskIndex = taskIndex;
|
||||
|
||||
|
||||
@@ -282,6 +282,7 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
|
||||
struct EventStruct TempEvent(taskIndex);
|
||||
|
||||
ExtraTaskSettings.clear();
|
||||
Cache.clearTaskCaches();
|
||||
ExtraTaskSettings.TaskIndex = taskIndex;
|
||||
|
||||
// Save selected output type.
|
||||
@@ -379,6 +380,7 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
|
||||
String dummy;
|
||||
|
||||
if (Device[DeviceIndex].ExitTaskBeforeSave) {
|
||||
SaveTaskSettings(taskIndex);
|
||||
PluginCall(PLUGIN_EXIT, &TempEvent, dummy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user