increase default timeout to 60 seconds

This commit is contained in:
Alan Hamlett 2016-04-19 13:50:29 +02:00
parent 18f588104d
commit 984a8ab62a
3 changed files with 5 additions and 4 deletions

View File

@ -49,7 +49,7 @@ optional arguments:
--logfile LOGFILE defaults to ~/.wakatime.log
--apiurl API_URL heartbeats api url; for debugging with a local server
--timeout TIMEOUT number of seconds to wait when sending heartbeats to
api
api; defaults to 60 seconds
--config CONFIG defaults to ~/.wakatime.conf
--verbose turns on debug messages in log file
--version show program's version number and exit

View File

@ -490,7 +490,7 @@ class BaseTestCase(utils.TestCase):
self.patched['wakatime.offlinequeue.Queue.push'].assert_not_called()
self.patched['wakatime.offlinequeue.Queue.pop'].assert_called_once_with()
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].assert_called_once_with(ANY, cert=None, proxies={'https': 'localhost:1234'}, stream=False, timeout=30, verify=True)
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].assert_called_once_with(ANY, cert=None, proxies={'https': 'localhost:1234'}, stream=False, timeout=60, verify=True)
def test_entity_type_domain(self):
response = Response()

View File

@ -158,7 +158,8 @@ def parseArguments():
parser.add_argument('--apiurl', dest='api_url',
help='heartbeats api url; for debugging with a local server')
parser.add_argument('--timeout', dest='timeout', type=int,
help='number of seconds to wait when sending heartbeats to api')
help='number of seconds to wait when sending heartbeats to api; '+
'defaults to 60 seconds')
parser.add_argument('--config', dest='config',
help='defaults to ~/.wakatime.conf')
parser.add_argument('--verbose', dest='verbose', action='store_true',
@ -307,7 +308,7 @@ def send_heartbeat(project=None, branch=None, hostname=None, stats={}, key=None,
if not api_url:
api_url = 'https://api.wakatime.com/api/v1/heartbeats'
if not timeout:
timeout = 30
timeout = 60
log.debug('Sending heartbeat to api at %s' % api_url)
data = {
'time': timestamp,