Bug 9726 - XISBN service throttle not initialized
Summary: XISBN service throttle not initialized
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin SOMERS
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-28 09:03 UTC by Fridolin SOMERS
Modified: 2014-05-26 21:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (2.46 KB, patch)
2013-02-28 09:18 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 9726: XISBN service throttle not initialized (2.60 KB, patch)
2013-03-19 17:04 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 9726: XISBN service throttle not initialized (2.69 KB, patch)
2013-03-30 22:31 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2013-02-28 09:03:37 UTC
For limiting XISBN API use, XISBNDailyLimit syspref is used to compare with daily use count of the API. This count is stored in services_throttle table.
But this table content is never initialized, not in installer nor in updatedatabase. So count is never increased and API is used without limit.
Comment 1 Fridolin SOMERS 2013-02-28 09:18:38 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-03-19 17:04:31 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-03-30 22:31:34 UTC
Created attachment 17063 [details] [review]
[PASSED QA] Bug 9726: XISBN service throttle not initialized

For limiting XISBN API use, XISBNDailyLimit syspref is used to compare
with daily use count of the API. This count is stored in
services_throttle table. But this table content is never initialized,
not in installer nor in updatedatabase. So count is never increased and
API is used without limit.

This patch add an insert of service type in services_throttle if not
existing. So service throttle will be initialized.

Test plan :
- Check that you don't have a line in services_throttle for
  service_type=xisbn
- Activate FRBRizeEditions and XISBN sysprefs
- Set a small number in XISBNDailyLimit (ie 5)
- Go to a biblio page (with ISBN)
- Look at services_throttle table
  => you should have a line for service_type=xisbn with service_count=1.
- Refresh biblio page untill limit is reached
  => service_count should be equal to limit for service_type=xisbn

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Passes test plan correctly.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Fixes problem, tested according to test plan.
Comment 4 Jared Camins-Esakov 2013-03-31 02:05:51 UTC
This patch has been pushed to master.
Comment 5 Chris Cormack 2013-03-31 06:40:49 UTC
Pushed to 3.10.x and 3.8.x will be in 3.10.5 and 3.8.12