Skip to content

Commit ada9ac4

Browse files
author
Phillip Simonds
committed
Add timeout param to InfrahubClient create method.
1 parent 337ad72 commit ada9ac4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

infrahub_sdk/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,12 @@ async def create(
299299
kind: Union[str, type[SchemaType]],
300300
data: Optional[dict] = None,
301301
branch: Optional[str] = None,
302+
timeout: Optional[int] = None,
302303
**kwargs: Any,
303304
) -> Union[InfrahubNode, SchemaType]:
304305
branch = branch or self.default_branch
305306

306-
schema = await self.schema.get(kind=kind, branch=branch)
307+
schema = await self.schema.get(kind=kind, branch=branch, timeout=timeout)
307308

308309
if not data and not kwargs:
309310
raise ValueError("Either data or a list of keywords but be provided")
@@ -1430,10 +1431,11 @@ def create(
14301431
kind: Union[str, type[SchemaTypeSync]],
14311432
data: Optional[dict] = None,
14321433
branch: Optional[str] = None,
1434+
timeout: Optional[int] = None,
14331435
**kwargs: Any,
14341436
) -> Union[InfrahubNodeSync, SchemaTypeSync]:
14351437
branch = branch or self.default_branch
1436-
schema = self.schema.get(kind=kind, branch=branch)
1438+
schema = self.schema.get(kind=kind, branch=branch, timeout=timeout)
14371439

14381440
if not data and not kwargs:
14391441
raise ValueError("Either data or a list of keywords but be provided")

0 commit comments

Comments
 (0)