Skip to content

Commit 201f0bc

Browse files
committed
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
1 parent b7ab14d commit 201f0bc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libsync/owncloudpropagator_p.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,13 @@ inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror,
5959
if (httpCode == 503) {
6060
// When the server is in maintenance mode, we want to exit the sync immediatly
6161
// so that we do not flood the server with many requests
62-
return errorBody.contains(R"(>Sabre\DAV\Exception\ServiceUnavailable<)") ?
63-
SyncFileItem::FatalError : SyncFileItem::NormalError;
62+
// BUG: This relies on a translated string and is thus unreliable.
63+
// In the future it should return a NormalError and trigger a status.php
64+
// check that detects maintenance mode reliably and will terminate the sync run.
65+
auto probablyMaintenance =
66+
errorBody.contains(R"(>Sabre\DAV\Exception\ServiceUnavailable<)")
67+
&& !errorBody.contains("Storage is temporarily not available");
68+
return probablyMaintenance ? SyncFileItem::FatalError : SyncFileItem::NormalError;
6469
}
6570

6671
if (httpCode == 412) {

0 commit comments

Comments
 (0)