Browse Source

Do not restart after failed web upgrade

fastled
Xose Pérez 7 years ago
parent
commit
576ab680e9
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      code/espurna/web.ino

+ 5
- 3
code/espurna/web.ino View File

@ -823,9 +823,11 @@ void _onHome(AsyncWebServerRequest *request) {
void _onUpgrade(AsyncWebServerRequest *request) { void _onUpgrade(AsyncWebServerRequest *request) {
AsyncWebServerResponse *response = request->beginResponse(200, "text/plain", Update.hasError() ? "FAIL" : "OK"); AsyncWebServerResponse *response = request->beginResponse(200, "text/plain", Update.hasError() ? "FAIL" : "OK");
response->addHeader("Connection", "close"); response->addHeader("Connection", "close");
deferred.once_ms(100, []() {
ESP.restart();
});
if (!Update.hasError()) {
deferred.once_ms(100, []() {
ESP.restart();
});
}
request->send(response); request->send(response);
} }


Loading…
Cancel
Save