[Bug 43799] New: cart_to_shelf cron waits an extra hour to update items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 Bug ID: 43799 Summary: cart_to_shelf cron waits an extra hour to update items Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz Depends on: 43546 Target Milestone: --- The cart to shelf cron says: --hours | -h The number of hours that need to pass before the location is updated. But it's query is: SELECT itemnumber FROM items WHERE location = 'CART' AND TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) > ? TIMESTAMPDIFF returns the number of full hours between two times. This means that if I give the cron a parameter of 1, my item will not update until it's been 2 full hours since the item was returned. Assume the item was returned at 8:00 and I've given the cron a parameter of --hours 1 At 8:59, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) = 0 At 9:00, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) = 1 At 9:59, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) = 1 at 10:00, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) = 2 -- it's finally greater than 1 and my item updates Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43546 [Bug 43546] Standardize command-line scripts on Getopt::Long::Descriptive for safer, more consistent option handling -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |andrew@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 --- Comment #1 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 207911 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207911&action=edit Bug 43799: Update cart_to_shelf to use greater than or equal To test 1 - from the commandline, set up two items with location CART and timestamps 1 and 2 hours in the past sudo koha-mysql kohadev update items set location='CART',permanent_location='GEN',timestamp=date_sub(now(),interval 121 minute) where barcode=39999000005592; update items set location='CART',permanent_location='GEN',timestamp=date_sub(now(),interval 61 minute) where barcode=39999000005578; 2 - in the staff interface, load biblio 134 and confirm items show shelving location "General stacks (Book cart)" 3 - OPTIONAL, check those timestamps and TIMESTAMPDIFF values: SELECT barcode, timestamp, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) from items where barcode in (39999000005592,39999000005578); 4 - run the cron for 1 hour perl misc/cronjobs cart_to_shelf.pl -h 1 5 - confirm neither item updated 6 - run the cron for 2 hours perl misc/cronjobs cart_to_shelf.pl -h 2 7 - confirm 1 item updated 8 - run the cron for 3 hours perl misc/cronjobs cart_to_shelf.pl -h 3 9 - confirm the second item updated APPLY PATCH, restart_all 10 - repeat steps 1 - 4 11 - confirm 1 item updated 12 - repeat step 6 13 - confirm the other item updated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Oop, correcting my own test plan: To test 1 - from the commandline, set up two items with location CART and timestamps 1 and 2 hours in the past sudo koha-mysql kohadev update items set location='CART',permanent_location='GEN',timestamp=date_sub(now(),interval 121 minute) where barcode=39999000005592; update items set location='CART',permanent_location='GEN',timestamp=date_sub(now(),interval 61 minute) where barcode=39999000005578; 2 - in the staff interface, load biblio 134 and confirm items show shelving location "General stacks (Book cart)" 3 - OPTIONAL, check those timestamps and TIMESTAMPDIFF values: SELECT barcode, timestamp, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) from items where barcode in (39999000005592,39999000005578); 4 - run the cron for 2 hours perl misc/cronjobs cart_to_shelf.pl -h 2 5 - confirm neither item updated 6 - run the cron for 1 hours perl misc/cronjobs cart_to_shelf.pl -h 1 7 - confirm 1 item updated APPLY PATCH, restart_all 8 - repeat steps 1 - 4 9 - confirm 1 item updated 10 - repeat step 6 11 - confirm the other item updated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207911|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 207933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207933&action=edit Bug 43799: Update cart_to_shelf to use greater than or equal To test 1 - from the commandline, set up two items with location CART and timestamps 1 and 2 hours in the past sudo koha-mysql kohadev update items set location='CART',permanent_location='GEN',timestamp=date_sub(now(),interval 121 minute) where barcode=39999000005592; update items set location='CART',permanent_location='GEN',timestamp=date_sub(now(),interval 61 minute) where barcode=39999000005578; 2 - in the staff interface, load biblio 134 and confirm items show shelving location "General stacks (Book cart)" 3 - OPTIONAL, check those timestamps and TIMESTAMPDIFF values: SELECT barcode, timestamp, TIMESTAMPDIFF(HOUR, items.timestamp, NOW()) from items where barcode in (39999000005592,39999000005578); 4 - run the cron for 1 hour perl misc/cronjobs cart_to_shelf.pl -h 1 5 - confirm neither item updated 6 - run the cron for 2 hours perl misc/cronjobs cart_to_shelf.pl -h 2 7 - confirm 1 item updated 8 - run the cron for 3 hours perl misc/cronjobs cart_to_shelf.pl -h 3 9 - confirm the second item updated APPLY PATCH, restart_all 10 - repeat steps 1 - 4 11 - confirm 1 item updated 12 - repeat step 6 13 - confirm the other item updated Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43799 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jrobb@sekls.org |y.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org