Merge pull request #4203 from annando/dbupdate-food

The automatic database update had worked endlessly
This commit is contained in:
Hypolite Petovan 2018-01-10 17:54:14 -05:00 committed by GitHub
commit 0c6c922ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -664,7 +664,7 @@ function check_db($via_worker)
$build = Config::get('system', 'build'); $build = Config::get('system', 'build');
if (empty($build)) { if (empty($build)) {
Config::set('system', 'build', DB_UPDATE_VERSION); Config::set('system', 'build', DB_UPDATE_VERSION - 1);
$build = DB_UPDATE_VERSION; $build = DB_UPDATE_VERSION;
} }
@ -712,9 +712,9 @@ function update_db()
{ {
$build = Config::get('system', 'build'); $build = Config::get('system', 'build');
if (empty($build)) { if (empty($build) || ($build > DB_UPDATE_VERSION)) {
Config::set('system', 'build', DB_UPDATE_VERSION); $build = DB_UPDATE_VERSION - 1;
$build = DB_UPDATE_VERSION; Config::set('system', 'build', $build);
} }
if ($build != DB_UPDATE_VERSION) { if ($build != DB_UPDATE_VERSION) {
@ -789,12 +789,12 @@ function run_update_function($x)
return false; return false;
} else { } else {
Config::set('database', 'update_' . $x, 'success'); Config::set('database', 'update_' . $x, 'success');
Config::set('system', 'build', $x + 1); Config::set('system', 'build', $x);
return true; return true;
} }
} else { } else {
Config::set('database', 'update_' . $x, 'success'); Config::set('database', 'update_' . $x, 'success');
Config::set('system', 'build', $x + 1); Config::set('system', 'build', $x);
return true; return true;
} }
} }