@@ -346,12 +346,13 @@ def post_to_worker(
346346 worker : str , endpoint : str , json : dict | None = None , params : dict | None = None
347347) -> tuple [str , Any ]:
348348 try :
349- r = post_into (resolve_to_address (worker ), endpoint , json = json , params = params , timeout = 1 )
349+ address = resolve_to_address (worker )
350+ r = post_into (address , endpoint , json = json , params = params , timeout = 1 )
350351 r .raise_for_status ()
351352 return worker , r .json () if r .content else None
352353 except (HTTPErrorStatus , HTTPException ) as e :
353354 logger .error (
354- f"Could not post to { worker } 's { endpoint = } , sent { json = } and returned { e } . Check connection?"
355+ f"Could not post to { worker } 's { address = } / { endpoint = } , sent { json = } and returned { e } . Check connection? Check port ?"
355356 )
356357 return worker , None
357358 except DecodeError :
@@ -393,15 +394,17 @@ def get_from_worker(
393394 worker : str , endpoint : str , json : dict | None = None , timeout = 1.0 , return_raw = False
394395) -> tuple [str , Any ]:
395396 try :
396- r = get_from (resolve_to_address (worker ), endpoint , json = json , timeout = timeout )
397+ address = resolve_to_address (worker )
398+
399+ r = get_from (address , endpoint , json = json , timeout = timeout )
397400 r .raise_for_status ()
398401 if not return_raw :
399402 return worker , r .json () if r .content else None
400403 else :
401404 return worker , r .content or None
402405 except (HTTPErrorStatus , HTTPException ) as e :
403406 logger .error (
404- f"Could not get from { worker } 's { endpoint = } , sent { json = } and returned { e } . Check connection?"
407+ f"Could not get from { worker } 's { address = } / { endpoint = } , sent { json = } and returned { e } . Check connection? Check port ?"
405408 )
406409 return worker , None
407410 except DecodeError :
@@ -436,12 +439,13 @@ def multicast_get_across_cluster(
436439@huey .task (priority = 10 )
437440def patch_to_worker (worker : str , endpoint : str , json : dict | None = None ) -> tuple [str , Any ]:
438441 try :
439- r = patch_into (resolve_to_address (worker ), endpoint , json = json , timeout = 1 )
442+ address = resolve_to_address (worker )
443+ r = patch_into (address , endpoint , json = json , timeout = 1 )
440444 r .raise_for_status ()
441445 return worker , r .json () if r .content else None
442446 except (HTTPErrorStatus , HTTPException ) as e :
443447 logger .error (
444- f"Could not PATCH to { worker } 's { endpoint = } , sent { json = } and returned { e } . Check connection?"
448+ f"Could not PATCH to { worker } 's { address = } / { endpoint = } , sent { json = } and returned { e } . Check connection? Check port ?"
445449 )
446450 return worker , None
447451 except DecodeError :
0 commit comments