From 90a00662ffc9f635777e06f3b602d88029319fa7 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 10 Jan 2018 22:44:38 +0000 Subject: [PATCH] The automatic database update had worked endlessly --- boot.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index e47665f94d..48eaeb6f3b 100644 --- a/boot.php +++ b/boot.php @@ -664,7 +664,7 @@ function check_db($via_worker) $build = Config::get('system', 'build'); if (empty($build)) { - Config::set('system', 'build', DB_UPDATE_VERSION); + Config::set('system', 'build', DB_UPDATE_VERSION - 1); $build = DB_UPDATE_VERSION; } @@ -712,9 +712,9 @@ function update_db() { $build = Config::get('system', 'build'); - if (empty($build)) { - Config::set('system', 'build', DB_UPDATE_VERSION); - $build = DB_UPDATE_VERSION; + if (empty($build) || ($build > DB_UPDATE_VERSION)) { + $build = DB_UPDATE_VERSION - 1; + Config::set('system', 'build', $build); } if ($build != DB_UPDATE_VERSION) { @@ -789,12 +789,12 @@ function run_update_function($x) return false; } else { Config::set('database', 'update_' . $x, 'success'); - Config::set('system', 'build', $x + 1); + Config::set('system', 'build', $x); return true; } } else { Config::set('database', 'update_' . $x, 'success'); - Config::set('system', 'build', $x + 1); + Config::set('system', 'build', $x); return true; } } -- 2.39.5