Fix issue where reset of server was prematurely causing the drop of

an ajax connection which was causing an error popup.
This commit is contained in:
Roxanne Skelly 2019-07-26 16:57:05 -07:00
parent 03b146cfb2
commit 701c457ad4
2 changed files with 18 additions and 6 deletions

View file

@ -70,11 +70,23 @@ $(document).ready(function(){
var ajaxObject = $.ajax(ajaxParams);
ajaxObject.fail(function (jqXHR, textStatus, errorThrown) {
showErrorMessage(
"Error",
"There was a problem restoring domain content.\n"
+ "Please ensure that the content archive or entity file is valid and try again."
);
// status of 0 means the connection was reset, which
// happens after the content is parsed and the server restarts
// in the case of json and json.gz files
if (jqXHR.status != 0) {
showErrorMessage(
"Error",
"There was a problem restoring domain content.\n"
+ "Please ensure that the content archive or entity file is valid and try again."
);
} else {
isRestoring = true;
// immediately reload backup information since one should be restoring now
reloadBackupInformation();
swal.close();
}
});
updateProgressBars($('.upload-content-progress'), (offset + nextChunkSize) * 100 / fileSize);

View file

@ -2190,7 +2190,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
return true;
} else if (url.path() == URI_RESTART) {
connection->respond(HTTPConnection::StatusCode200);
connection->respond(HTTPConnection::StatusCode204);
restart();
return true;
} else if (url.path() == URI_API_METAVERSE_INFO) {