[Koha-bugs] [Bug 26596] updatedatabase.pl uses too much CPU when it has 0 updates to run

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 25 02:37:31 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26596

--- Comment #3 from David Cook <dcook at prosentient.com.au> ---
All we need to do is the following at the top of updatedatabase.pl:

my $original_version = C4::Context->preference("Version");
my $code_version = $Koha::VERSION;

if ( $original_version >= TransformToNum($code_version){
    exit 0;
}

--

If the code version is the same or higher than the current database version,
then there cannot possibly be any database updates to run, and we should exit
immediately, rather than consuming 100% CPU for way too long by doing 23,000
lines of updates.

This is a short-term solution as overhauling the database update system is the
long-term solution.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list