Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions miles/utils/http_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,9 @@ async def post(url, payload, max_retries=60, action="post"):
# If distributed mode is enabled and actors exist, dispatch via Ray.
if _distributed_post_enabled and _post_actors:
try:
import ray

actor = _next_actor()
if actor is not None:
# Use a thread to avoid blocking the event loop on ray.get
obj_ref = actor.do_post.remote(url, payload, max_retries, action=action)
return await asyncio.to_thread(ray.get, obj_ref)
return await actor.do_post.remote(url, payload, max_retries, action=action)
except Exception as e:
logger.info(f"[http_utils] Distributed POST failed, falling back to local: {e} (url={url})")
# fall through to local
Expand Down
Loading