From: Christian Kamm Date: Mon, 12 Aug 2019 07:07:56 +0000 (+0200) Subject: Don't fatal on "Storage temporarily unavailable" X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~193 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0ac8a3e6be4492b79822603b3abe24e44ad0f8c9;p=nextcloud-desktop.git Don't fatal on "Storage temporarily unavailable" This is an unreliable workaround. The real fix will need to be deferred to another release. For #5088 --- diff --git a/src/libsync/owncloudpropagator_p.h b/src/libsync/owncloudpropagator_p.h index 6b4ad3748..d6ae07a3a 100644 --- a/src/libsync/owncloudpropagator_p.h +++ b/src/libsync/owncloudpropagator_p.h @@ -59,8 +59,13 @@ inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror, if (httpCode == 503) { // When the server is in maintenance mode, we want to exit the sync immediatly // so that we do not flood the server with many requests - return errorBody.contains(R"(>Sabre\DAV\Exception\ServiceUnavailable<)") ? - SyncFileItem::FatalError : SyncFileItem::NormalError; + // BUG: This relies on a translated string and is thus unreliable. + // In the future it should return a NormalError and trigger a status.php + // check that detects maintenance mode reliably and will terminate the sync run. + auto probablyMaintenance = + errorBody.contains(R"(>Sabre\DAV\Exception\ServiceUnavailable<)") + && !errorBody.contains("Storage is temporarily not available"); + return probablyMaintenance ? SyncFileItem::FatalError : SyncFileItem::NormalError; } if (httpCode == 412) {