Skip to content

Commit 678982d

Browse files
authored
Merge pull request #13 from molssi-seamm/dev
Increased timeout for HTTP requests
2 parents c9f8e24 + 0c334de commit 678982d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
=======
22
History
33
=======
4+
2025.4.3 -- Increased timeout for HTTP requests
5+
* Increased the default timout to 5 seconds, and 60 seconds for submitting jobs to
6+
allow time to transfer files.
7+
48
2024.6.27 -- Added support for using local files in Jobs
59

610
2024.5.23 -- Bugfix: crash opening a flowchart from a Dashboard

seamm_dashboard_client/dashboard.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self, dashboard, *args):
7373

7474
class Dashboard(object):
7575
def __init__(
76-
self, name, url, username=None, password=None, user_agent=None, timeout=1
76+
self, name, url, username=None, password=None, user_agent=None, timeout=5
7777
):
7878
"""The interface to a Dashboard
7979
@@ -549,7 +549,7 @@ def submit(
549549
# Now transfer the files
550550
for filename, newname in files.items():
551551
logger.info(f" {filename} --> {newname}")
552-
result = job.put_file(filename, newname)
552+
result = job.put_file(filename, newname, timeout=60)
553553
if result is None:
554554
logger.warning(
555555
f"There was a major error transferring the file {filename} to "
@@ -919,7 +919,7 @@ def get_file(self, filename):
919919

920920
return response.content.decode(encoding="UTF-8")
921921

922-
def put_file(self, localfile, remotefile):
922+
def put_file(self, localfile, remotefile, timeout=60):
923923
"""Put a file to a job.
924924
925925
Parameters
@@ -935,7 +935,7 @@ def put_file(self, localfile, remotefile):
935935
headers = {"Content-Type": m.content_type}
936936

937937
response = self.dashboard._url_post(
938-
f"/api/jobs/{self.id}/files", headers=headers, data=m
938+
f"/api/jobs/{self.id}/files", headers=headers, data=m, timeout=timeout
939939
)
940940

941941
return response

0 commit comments

Comments
 (0)