| Summary: | Unnecessary DB access in Koha::Item::Transfer->receive | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Component: | Architecture, internals, and plumbing | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Status: | Pushed to main --- | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | martin.renvoize, tomascohen |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
25.11.00
|
|
| Circulation function: | |||
| Bug Depends on: | 25767 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 40919: Remove unnecessary DB call in Koha::Item::Transfer->receive
Bug 40919: Remove unnecessary DB call in Koha::Item::Transfer->receive |
||
Created attachment 187143 [details] [review] Bug 40919: Remove unnecessary DB call in Koha::Item::Transfer->receive This patch removes a trivially not required DB object instantiation. This implies saving CPU usage for the instantiation and algo for fetching from the DB. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Item/Transfer.t => SUCCESS: Tests pass! They cover ->receive() 2. Apply this patch 3. Repeat 1 => SUCCESS: No behavior change, tests pass! 4. Sign off :-D Created attachment 189675 [details] [review] Bug 40919: Remove unnecessary DB call in Koha::Item::Transfer->receive This patch removes a trivially not required DB object instantiation. This implies saving CPU usage for the instantiation and algo for fetching from the DB. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Item/Transfer.t => SUCCESS: Tests pass! They cover ->receive() 2. Apply this patch 3. Repeat 1 => SUCCESS: No behavior change, tests pass! 4. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Nice work everyone! Pushed to main for 25.11 |
This line: ```perl ModDateLastSeen( $self->item->itemnumber ); ``` could just be ```perl ModDateLastSeen( $self->itemnumber ); ``` There's no need to instantiate the related Koha::Item object.