Commit a9b701c7 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 86e4616a
......@@ -63,8 +63,18 @@ class InPlaceUpdate {
$modified = self::checkModifiedFiles($project_name, $archive);
if (!$modified && self::backup($archive, $project_root)) {
watchdog('automatic_updates', 'In place update has started.', [], WATCHDOG_INFO);
$success = self::processUpdate($archive, $project_root);
watchdog('automatic_updates', 'In place update has finished.', [], WATCHDOG_INFO);
try {
$success = self::processUpdate($archive, $project_root);
watchdog('automatic_updates', 'In place update has finished.', [], WATCHDOG_INFO);
}
catch (\Throwable $throwable) {
watchdog('automatic_updates', 'In place update has failed.', [], WATCHDOG_ERROR);
watchdog_exception($throwable);
}
catch (\Exception $exception) {
watchdog('automatic_updates', 'In place update has failed.', [], WATCHDOG_ERROR);
watchdog_exception($exception);
}
$result = automatic_updates_exec_command('updatedb:status');
if (!empty($result['return_code'] || !empty($result['output']))) {
// Rollback if there are database updates in the update.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment