Skip to content

Commit 2981380

Browse files
authored
fix: abort upgrade process if a step fails (#2095)
1 parent b6a3608 commit 2981380

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

library/Upgrade.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,10 @@ public function initUpgrade()
10901090
if ($this->{$funcName}($this->db)) {
10911091
update_option($this->dbVersionKey, (int) $currentDbVersion);
10921092
wp_cache_flush();
1093+
} else {
1094+
delete_transient($lockKey);
1095+
error_log('Upgrade function ' . $funcName . ' failed. Aborting upgrade process.');
1096+
break;
10931097
}
10941098

10951099
delete_transient($lockKey);

0 commit comments

Comments
 (0)