[mythtv-commits] Ticket #13325: tmdb3 python bindings wait too long for the API rate limit to expire
MythTV
noreply at mythtv.org
Sun Sep 30 23:21:06 UTC 2018
#13325: tmdb3 python bindings wait too long for the API rate limit to expire
-----------------------------------+----------------------------
Reporter: jasongillis | Owner: Raymond Wagner
Type: Patch - Bug Fix | Status: new
Priority: trivial | Milestone: needs_triage
Component: Bindings - Python | Version: Master Head
Severity: medium | Keywords:
Ticket locked: 0 |
-----------------------------------+----------------------------
For a long time now, I've been noticing that fetching video metadata
became really slow. I put up with it (for three years!) until this
weekend when I had some time to dig in. In looking at the debug for
tmdb3.py, it notes that after 40 queries, it sleeps for 10 seconds. It
should be sleeping until the current 40 reqs / 10 seconds rate window is
closed instead of waiting 10 seconds. I was seeing 40 requests in about 9
seconds due to network latency, so it should have been sleeping 1 second
or so.
It turns out that when handling of the rate limiting was put in, max() was
used instead of min(). The section of code that changed should have used
min() since it needs to wait for up to 10 seconds to comply with the rate
limit guidelines set by tmdb (https://www.themoviedb.org/faq/api).
Pull request for this trivial change is:
https://github.com/MythTV/mythtv/pull/171
This is my first ever pull request, so let me know if I've done this
wrong.
Thanks,
Jason
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13325>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list