Skip to content
Snippets Groups Projects
Commit b001cf3b authored by Lucas Hedding's avatar Lucas Hedding Committed by Lucas Hedding
Browse files

Issue #3094513 by heddn: Try/catch /Exception to rollback entire update if anything happens

parent 45cfddf8
No related branches found
No related tags found
No related merge requests found
...@@ -9,11 +9,6 @@ build: ...@@ -9,11 +9,6 @@ build:
sniff-all-files: true sniff-all-files: true
halt-on-fail: true halt-on-fail: true
testing: testing:
container_command:
commands:
- cd ${SOURCE_DIR} && sudo -u www-data curl https://www.drupal.org/files/issues/2019-10-07/3085728.patch | git apply -
- cd ${SOURCE_DIR} && sudo -u www-data curl https://www.drupal.org/files/issues/2019-10-16/3088400-8_0.patch | git apply -
- cd ${SOURCE_DIR} && sudo -u www-data curl https://www.drupal.org/files/issues/2019-10-16/3088447.patch | git apply -
# run_tests task is executed several times in order of performance speeds. # run_tests task is executed several times in order of performance speeds.
# halt-on-fail can be set on the run_tests tasks in order to fail fast. # halt-on-fail can be set on the run_tests tasks in order to fail fast.
# suppress-deprecations is false in order to be alerted to usages of # suppress-deprecations is false in order to be alerted to usages of
......
...@@ -149,8 +149,18 @@ class InPlaceUpdate implements UpdateInterface { ...@@ -149,8 +149,18 @@ class InPlaceUpdate implements UpdateInterface {
$modified = $this->checkModifiedFiles($metadata, $archive); $modified = $this->checkModifiedFiles($metadata, $archive);
if (!$modified && $this->backup($archive, $project_root)) { if (!$modified && $this->backup($archive, $project_root)) {
$this->logger->info('In place update has started.'); $this->logger->info('In place update has started.');
$success = $this->processUpdate($archive, $project_root); try {
$this->logger->info('In place update has finished.'); $success = $this->processUpdate($archive, $project_root);
$this->logger->info('In place update has finished.');
}
catch (\Throwable $throwable) {
$this->logger->info('In place update failed.');
watchdog_exception($throwable);
}
catch (\Exception $exception) {
$this->logger->info('In place update failed.');
watchdog_exception($exception);
}
if ($success) { if ($success) {
$process = automatic_updates_console_command('updatedb:status'); $process = automatic_updates_console_command('updatedb:status');
if ($success && $process->getOutput()) { if ($success && $process->getOutput()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment