Handle db update errors better in the installer (#9701)

* Handle db update errors better in the installer

* show retry button on error, add exclamation point so we don't do that accidentally
This commit is contained in:
Tony Murray
2019-01-23 23:42:19 -06:00
committed by GitHub
parent 1bb782b6d5
commit 59aa4f36e9
2 changed files with 11 additions and 4 deletions

View File

@@ -57,12 +57,15 @@ $db_vars = array(
]); ]);
\Artisan::call('migrate', ['--seed' => true, '--force' => true , '--database' => 'setup']);
$fp = \Artisan::output();
echo "Starting Update...\n"; echo "Starting Update...\n";
try {
$ret = \Artisan::call('migrate', ['--seed' => true, '--force' => true, '--database' => 'setup']);
if ($fp) { echo \Artisan::output();
echo $fp;
echo $ret == 0 ? "\n\nSuccess!" : "\n\nError!";
} catch (Exception $e) {
echo $e->getMessage() . "\n\nError!";
} }
ob_end_flush(); ob_end_flush();

View File

@@ -318,6 +318,10 @@ echo "</td></tr>";
xhr.onprogress = function (e) { xhr.onprogress = function (e) {
output.innerHTML = e.currentTarget.responseText; output.innerHTML = e.currentTarget.responseText;
output.scrollTop = output.scrollHeight - output.clientHeight; // scrolls the output area output.scrollTop = output.scrollHeight - output.clientHeight; // scrolls the output area
if (output.innerHTML.indexOf('Error!') !== -1) {
// if error word in output, show the retry button
$("#retry-btn").css("display", "");
}
}; };
xhr.timeout = 90000; // if no response for 90s, allow the user to retry xhr.timeout = 90000; // if no response for 90s, allow the user to retry
xhr.ontimeout = function (e) { xhr.ontimeout = function (e) {