Summary: | updatedatabase.pl uses too much CPU when it has 0 updates to run | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Architecture, internals, and plumbing | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | ||
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: |
Description
David Cook
2020-10-02 01:04:49 UTC
This isn't an urgent matter for me, so I'm not going to mark myself as the Assignee, but I may get to this at some point. I'm noticing that updatedatabase.pl uses 100% CPU and runs for a while, so this is just annoying me too much now. Rather than make the change to koha-upgrade-schema though, I'm going to change updatedatabase.pl. 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. |