Skip to content

Commit 3e2f212

Browse files
speed mm
1 parent 488efd7 commit 3e2f212

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

fastdeploy/utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,8 @@ def _bos_download(bos_client, link):
11351135
def _fetch_one(link):
11361136
"""Fetch + deserialize a single link, with optional retry on rate-limit.
11371137
1138-
Returns (True, obj) on success, (False, err_msg) on failure.
1138+
Returns (success, result) where result is the deserialized object on
1139+
success or an error message string on failure.
11391140
"""
11401141
try:
11411142
response = _bos_download(bos_client, link)
@@ -1166,9 +1167,9 @@ def _fetch_one(link):
11661167
# Sequential path: keep behavior identical for single link or when parallel disabled.
11671168
if max_workers <= 1 or len(bos_links) <= 1:
11681169
for link in bos_links:
1169-
ok, data = _fetch_one(link)
1170-
yield ok, data
1171-
if not ok:
1170+
success, result = _fetch_one(link)
1171+
yield success, result
1172+
if not success:
11721173
break
11731174
return
11741175

@@ -1178,9 +1179,9 @@ def _fetch_one(link):
11781179
with ThreadPoolExecutor(max_workers=workers) as ex:
11791180
futures = [ex.submit(_fetch_one, link) for link in bos_links]
11801181
for fut in futures:
1181-
ok, data = fut.result()
1182-
yield ok, data
1183-
if not ok:
1182+
success, result = fut.result()
1183+
yield success, result
1184+
if not success:
11841185
# Cancel any not-yet-started downloads; in-flight ones will
11851186
# finish but their results are discarded.
11861187
for f in futures:

0 commit comments

Comments
 (0)