Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

add timeout on request to deadline #149

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pype/plugins/global/publish/submit_publish_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _submit_deadline_post_job(self, instance, job):
# self.log.info(json.dumps(payload, indent=4, sort_keys=True))

url = "{}/api/jobs".format(self.DEADLINE_REST_URL)
response = requests.post(url, json=payload)
response = requests.post(url, json=payload, timeout=10)
if not response.ok:
raise Exception(response.text)

Expand Down
4 changes: 4 additions & 0 deletions pype/plugins/maya/publish/submit_maya_deadline.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ def _requests_post(self, *args, **kwargs):
"""
if 'verify' not in kwargs:
kwargs['verify'] = False if os.getenv("PYPE_DONT_VERIFY_SSL", True) else True # noqa
# add 10sec timeout before bailing out
kwargs['timeout'] = 10
return requests.post(*args, **kwargs)

def _requests_get(self, *args, **kwargs):
Expand All @@ -366,4 +368,6 @@ def _requests_get(self, *args, **kwargs):
"""
if 'verify' not in kwargs:
kwargs['verify'] = False if os.getenv("PYPE_DONT_VERIFY_SSL", True) else True # noqa
# add 10sec timeout before bailing out
kwargs['timeout'] = 10
return requests.get(*args, **kwargs)
2 changes: 1 addition & 1 deletion pype/plugins/nuke/publish/submit_nuke_deadline.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def payload_submit(self,
self.expected_files(instance, render_path)
self.log.debug("__ expectedFiles: `{}`".format(
instance.data["expectedFiles"]))
response = requests.post(self.deadline_url, json=payload)
response = requests.post(self.deadline_url, json=payload, timeout=10)

if not response.ok:
raise Exception(response.text)
Expand Down