Skip to content

Commit

Permalink
feat: increase request timeout for upload
Browse files Browse the repository at this point in the history
  • Loading branch information
paaragon committed Oct 10, 2024
1 parent bde319a commit 9c4db0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/qiskit_serverless/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

# request timeout
REQUESTS_TIMEOUT: int = 30
REQUESTS_STREAMING_TIMEOUT: int = 60
REQUESTS_TIMEOUT_OVERRIDE = "REQUESTS_TIMEOUT_OVERRIDE"

# gateway
Expand Down
4 changes: 2 additions & 2 deletions client/qiskit_serverless/core/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from opentelemetry import trace
from tqdm import tqdm

from qiskit_serverless.core.constants import REQUESTS_TIMEOUT
from qiskit_serverless.core.constants import REQUESTS_STREAMING_TIMEOUT, REQUESTS_TIMEOUT
from qiskit_serverless.utils.json import safe_json_request


Expand Down Expand Up @@ -95,7 +95,7 @@ def upload(self, file: str, provider: Optional[str] = None) -> Optional[str]:
data={"provider": provider},
stream=True,
headers={"Authorization": f"Bearer {self._token}"},
timeout=REQUESTS_TIMEOUT,
timeout=REQUESTS_STREAMING_TIMEOUT,
) as req:
if req.ok:
return req.text
Expand Down

0 comments on commit 9c4db0d

Please sign in to comment.