mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
chroma: set a default timeout of 10 seconds (#5898)
This prevents the `chroma` plugin from hanging the entire import process if the AcoustID API fails to respond.
This commit is contained in:
commit
e208d4bee3
2 changed files with 6 additions and 2 deletions
|
|
@ -98,7 +98,9 @@ def acoustid_match(log, path):
|
||||||
fp = fp.decode()
|
fp = fp.decode()
|
||||||
_fingerprints[path] = fp
|
_fingerprints[path] = fp
|
||||||
try:
|
try:
|
||||||
res = acoustid.lookup(API_KEY, fp, duration, meta="recordings releases")
|
res = acoustid.lookup(
|
||||||
|
API_KEY, fp, duration, meta="recordings releases", timeout=10
|
||||||
|
)
|
||||||
except acoustid.AcoustidError as exc:
|
except acoustid.AcoustidError as exc:
|
||||||
log.debug(
|
log.debug(
|
||||||
"fingerprint matching {0} failed: {1}",
|
"fingerprint matching {0} failed: {1}",
|
||||||
|
|
@ -292,7 +294,7 @@ def submit_items(log, userkey, items, chunksize=64):
|
||||||
"""Submit the current accumulated fingerprint data."""
|
"""Submit the current accumulated fingerprint data."""
|
||||||
log.info("submitting {0} fingerprints", len(data))
|
log.info("submitting {0} fingerprints", len(data))
|
||||||
try:
|
try:
|
||||||
acoustid.submit(API_KEY, userkey, data)
|
acoustid.submit(API_KEY, userkey, data, timeout=10)
|
||||||
except acoustid.AcoustidError as exc:
|
except acoustid.AcoustidError as exc:
|
||||||
log.warning("acoustid submission error: {0}", exc)
|
log.warning("acoustid submission error: {0}", exc)
|
||||||
del data[:]
|
del data[:]
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ Bug fixes:
|
||||||
- :doc:`plugins/lastgenre`: Fix the issue introduced in Beets 2.3.0 where
|
- :doc:`plugins/lastgenre`: Fix the issue introduced in Beets 2.3.0 where
|
||||||
non-whitelisted last.fm genres were not canonicalized to parent genres.
|
non-whitelisted last.fm genres were not canonicalized to parent genres.
|
||||||
:bug:`5930`
|
:bug:`5930`
|
||||||
|
- :doc:`plugins/chroma`: AcoustID lookup HTTP requests will now time out after
|
||||||
|
10 seconds, rather than hanging the entire import process.
|
||||||
|
|
||||||
For packagers:
|
For packagers:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue