Skip to content

Commit 8ce0ad7

Browse files
committed
chroma: set a default timeout of 10 seconds
TODO: Configurable timeouts :)
1 parent 0fec858 commit 8ce0ad7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

beetsplug/chroma.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ def acoustid_match(log, path):
9898
fp = fp.decode()
9999
_fingerprints[path] = fp
100100
try:
101-
res = acoustid.lookup(API_KEY, fp, duration, meta="recordings releases")
101+
res = acoustid.lookup(
102+
API_KEY, fp, duration, meta="recordings releases", timeout=10
103+
)
102104
except acoustid.AcoustidError as exc:
103105
log.debug(
104106
"fingerprint matching {0} failed: {1}",
@@ -292,7 +294,7 @@ def submit_chunk():
292294
"""Submit the current accumulated fingerprint data."""
293295
log.info("submitting {0} fingerprints", len(data))
294296
try:
295-
acoustid.submit(API_KEY, userkey, data)
297+
acoustid.submit(API_KEY, userkey, data, timeout=10)
296298
except acoustid.AcoustidError as exc:
297299
log.warning("acoustid submission error: {0}", exc)
298300
del data[:]

0 commit comments

Comments
 (0)