diff --git a/tests/samples/output/test_help_contents b/tests/samples/output/test_help_contents index 587b7d3..d59f7ad 100644 --- a/tests/samples/output/test_help_contents +++ b/tests/samples/output/test_help_contents @@ -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 diff --git a/tests/test_main.py b/tests/test_main.py index c39f53f..a818037 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -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() diff --git a/wakatime/main.py b/wakatime/main.py index f8aeb58..56b55ad 100644 --- a/wakatime/main.py +++ b/wakatime/main.py @@ -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,