mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 02:32:43 +02:00
check for recovery complete always, reload content page on restore
This commit is contained in:
parent
769d5677b1
commit
3f75bf62d5
2 changed files with 23 additions and 11 deletions
|
@ -5,6 +5,8 @@ $(document).ready(function(){
|
|||
var UPLOAD_CONTENT_ALLOWED_DIV_ID = 'upload-content-allowed';
|
||||
var UPLOAD_CONTENT_RECOVERING_DIV_ID = 'upload-content-recovering';
|
||||
|
||||
var isRestoring = false;
|
||||
|
||||
function progressBarHTML(extraClass, label) {
|
||||
var html = "<div class='progress'>";
|
||||
html += "<div class='" + extraClass + " progress-bar progress-bar-success progress-bar-striped active' role='progressbar' aria-valuemin='0' aria-valuemax='100'>";
|
||||
|
@ -64,6 +66,7 @@ $(document).ready(function(){
|
|||
contentType: false,
|
||||
data: fileFormData
|
||||
}).done(function(data, textStatus, jqXHR) {
|
||||
isRestoring = true;
|
||||
swal.close();
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
showErrorMessage(
|
||||
|
@ -138,6 +141,13 @@ $(document).ready(function(){
|
|||
return value.isManualBackup;
|
||||
});
|
||||
|
||||
if (isRestoring && !data.status.isRecovering) {
|
||||
// we were recovering and we finished - the DS is going to restart so show the restart modal
|
||||
showRestartModal();
|
||||
}
|
||||
|
||||
isRestoring = data.status.isRecovering;
|
||||
|
||||
manualBackups = splitBackups[0];
|
||||
automaticBackups = splitBackups[1];
|
||||
|
||||
|
@ -270,6 +280,7 @@ $(document).ready(function(){
|
|||
|
||||
// setup an AJAX POST to request content restore
|
||||
$.post('/api/backups/recover/' + backupID).done(function(data, textStatus, jqXHR) {
|
||||
isRestoring = true;
|
||||
swal.close();
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
showErrorMessage(
|
||||
|
|
|
@ -132,19 +132,20 @@ bool DomainContentBackupManager::process() {
|
|||
int64_t sinceLastSave = now - _lastCheck;
|
||||
int64_t intervalToCheck = _persistInterval * MSECS_TO_USECS;
|
||||
|
||||
if (_isRecovering) {
|
||||
bool isStillRecovering = any_of(begin(_backupHandlers), end(_backupHandlers), [](const BackupHandlerPointer& handler) {
|
||||
return handler->getRecoveryStatus().first;
|
||||
});
|
||||
|
||||
if (!isStillRecovering) {
|
||||
_isRecovering = false;
|
||||
_recoveryFilename = "";
|
||||
emit recoveryCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
if (sinceLastSave > intervalToCheck) {
|
||||
_lastCheck = now;
|
||||
if (_isRecovering) {
|
||||
bool isStillRecovering = any_of(begin(_backupHandlers), end(_backupHandlers), [](const BackupHandlerPointer& handler) {
|
||||
return handler->getRecoveryStatus().first;
|
||||
});
|
||||
|
||||
if (!isStillRecovering) {
|
||||
_isRecovering = false;
|
||||
_recoveryFilename = "";
|
||||
emit recoveryCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
if (!_isRecovering) {
|
||||
backup();
|
||||
|
|
Loading…
Reference in a new issue