Skip to content

Commit 458f87f

Browse files
committed
retry for process_folder get_job call
1 parent 37d2603 commit 458f87f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

musicai_sdk/process_folder.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ def process_file(client, file_path, output_folder, workflow_id, delete=True, fai
2323

2424
# Polling for job results
2525
while True:
26-
job_info = client.get_job(job_id=job_id)
26+
try:
27+
job_info = client.get_job(job_id=job_id)
28+
except Exception as e:
29+
logger.error(f"Failed to get job info for {file_name}: {e}")
30+
time.sleep(5)
31+
continue
2732
if job_info['status'] == 'SUCCEEDED':
2833
break
2934
if job_info['status'] == 'FAILED':

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "musicai-sdk"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "Python sdk for music.ai"
55
authors = ["Music.ai Support <support@music.ai>"]
66
license = "MIT"

0 commit comments

Comments
 (0)