Skip to content

Commit 356c866

Browse files
authored
Merge pull request #449 from rstudio/tdstein/442
Sets the CONNECT_TASK_TIMEOUT default to 86,400 (24 hours).
2 parents e895c7a + c6cc160 commit 356c866

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11-
- The `CONNECT_TASK_TIMEOUT` environment variable, which configures the timeout for [task based operations](https://docs.posit.co/connect/api/#get-/v1/tasks/-id-). This value translates into seconds (e.g., `CONNECT_TASK_TIMEOUT=60` is equivalent to 60 seconds.) By default, this value is set to [`sys.maxsize`](https://docs.python.org/3/library/sys.html#sys.maxsize).
11+
- The `CONNECT_TASK_TIMEOUT` environment variable, which configures the timeout for [task based operations](https://docs.posit.co/connect/api/#get-/v1/tasks/-id-). This value translates into seconds (e.g., `CONNECT_TASK_TIMEOUT=60` is equivalent to 60 seconds.) By default, this value is set to 86,400 seconds (e.g., 24 hours).
1212

1313
## [1.18.0] - 2023-06-27
1414

rsconnect/timeouts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import sys
32
from typing import Union
43

54
from rsconnect.exception import RSConnectException
@@ -8,7 +7,7 @@
87
_CONNECT_REQUEST_TIMEOUT_DEFAULT_VALUE: str = "300"
98

109
_CONNECT_TASK_TIMEOUT_KEY: str = "CONNECT_TASK_TIMEOUT"
11-
_CONNECT_TASK_TIMEOUT_DEFAULT_VALUE: str = str(sys.maxsize)
10+
_CONNECT_TASK_TIMEOUT_DEFAULT_VALUE: str = "86400"
1211

1312

1413
def get_request_timeout() -> int:
@@ -50,7 +49,7 @@ def get_task_timeout() -> int:
5049
5150
The timeout value is intended to be interpreted in seconds. A value of 60 is equal to sixty seconds, or one minute.
5251
53-
If CONNECT_TASK_TIMEOUT is unset, a default value of sys.maxsize is used.
52+
If CONNECT_TASK_TIMEOUT is unset, a default value of 86,400 (1 day) is used.
5453
5554
If CONNECT_TASK_TIMEOUT is set to a value less or equal to 0, an `RSConnectException` is raised.
5655

tests/test_timeouts.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import sys
32

43
from unittest import TestCase
54
from unittest.mock import patch
@@ -36,7 +35,7 @@ def test_get_negative_timeout_from_environment(self):
3635
class GetTaskTimeoutTestCase(TestCase):
3736
def test_get_default_timeout(self):
3837
timeout = get_task_timeout()
39-
self.assertEqual(sys.maxsize, timeout)
38+
self.assertEqual(24 * 60 * 60, timeout)
4039

4140
def test_get_valid_timeout_from_environment(self):
4241
with patch.dict(os.environ, {"CONNECT_TASK_TIMEOUT": "24"}):

0 commit comments

Comments
 (0)