From 37f0d5e6a5a3f5dc57cd92c6916890f72337c4a3 Mon Sep 17 00:00:00 2001 From: ztw Date: Tue, 16 Dec 2025 15:13:47 +0800 Subject: [PATCH] update apis.py, modify the default wait_nums value of function wait --- api/python/yr/apis.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/python/yr/apis.py b/api/python/yr/apis.py index f40e64b..909f488 100644 --- a/api/python/yr/apis.py +++ b/api/python/yr/apis.py @@ -328,7 +328,7 @@ def get(obj_refs: Union["ObjectRef", List, "RgObjectRef"], timeout: int = consta @check_initialized -def wait(obj_refs: Union[ObjectRef, List[ObjectRef]], wait_num: int = 1, +def wait(obj_refs: Union[ObjectRef, List[ObjectRef]], wait_num: Optional[int] = None, timeout: Optional[int] = None) -> Tuple[List[ObjectRef], List[ObjectRef]]: """ Wait for the value of the object in the data system to be ready based on the object's key. @@ -384,6 +384,9 @@ def wait(obj_refs: Union[ObjectRef, List[ObjectRef]], wait_num: int = 1, if len(obj_refs) != len(set(obj_refs)): raise ValueError( "obj_refs value error: duplicate obj_ref exists in the list") + + if wait_num is None: + wait_num = len(obj_refs) if wait_num == 0 or timeout == 0: return [], obj_refs -- Gitee