From 775b47c851216d25ee3b4ec2e4d5509e4a07223e Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 13 Oct 2015 11:21:53 -0400 Subject: [PATCH] Make sure we have defined timeouts on all our requests out to external build services Fixes #623 --- buildtrigger/bitbuckethandler.py | 2 +- buildtrigger/githubhandler.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/buildtrigger/bitbuckethandler.py b/buildtrigger/bitbuckethandler.py index 8dbd03329..669702b79 100644 --- a/buildtrigger/bitbuckethandler.py +++ b/buildtrigger/bitbuckethandler.py @@ -265,7 +265,7 @@ class BitbucketBuildTrigger(BuildTriggerHandler): trigger_uuid = self.trigger.uuid callback_url = '%s/oauth1/bitbucket/callback/trigger/%s' % (get_app_url(), trigger_uuid) - return BitBucket(key, secret, callback_url) + return BitBucket(key, secret, callback_url, timeout=5) def _get_authorized_client(self): """ Returns an authorized API client. """ diff --git a/buildtrigger/githubhandler.py b/buildtrigger/githubhandler.py index d60c802fb..1a74e5c2f 100644 --- a/buildtrigger/githubhandler.py +++ b/buildtrigger/githubhandler.py @@ -145,7 +145,8 @@ class GithubBuildTrigger(BuildTriggerHandler): return Github(self.auth_token, base_url=github_trigger.api_endpoint(), client_id=github_trigger.client_id(), - client_secret=github_trigger.client_secret()) + client_secret=github_trigger.client_secret(), + timeout=5) @classmethod def service_name(cls):