Skip to content

Commit e6f1a4d

Browse files
committed
client: increase firmware upload timeout to 60s and make it configurable
1 parent 0452913 commit e6f1a4d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

onekey_client/client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ def query(self, query: str, variables: Optional[Dict] = None, timeout=60):
179179

180180
@_tenant_required
181181
def upload_firmware(
182-
self, metadata: m.FirmwareMetadata, path: Path, *, enable_monitoring: bool
182+
self,
183+
metadata: m.FirmwareMetadata,
184+
path: Path,
185+
*,
186+
enable_monitoring: bool,
187+
timeout=60,
183188
):
184189
variables = {
185190
"firmware": {
@@ -202,7 +207,9 @@ def upload_firmware(
202207
raise errors.QueryError(res["createFirmwareUpload"]["errors"])
203208

204209
upload_url = res["createFirmwareUpload"]["uploadUrl"]
205-
res = self._post_with_token(upload_url, files={"firmware": path.open("rb")})
210+
res = self._post_with_token(
211+
upload_url, files={"firmware": path.open("rb")}, timeout=timeout
212+
)
206213
return res
207214

208215
@_tenant_required

0 commit comments

Comments
 (0)