mirror of https://gitee.com/bigwinds/arangodb
issue #1159: allow --server.request-timeout and --server.connect-timeout of 0
This commit is contained in:
parent
1fdf74e09e
commit
f1f0269eb9
|
@ -47,6 +47,8 @@ double const ArangoClient::DEFAULT_CONNECTION_TIMEOUT = 3.0;
|
|||
double const ArangoClient::DEFAULT_REQUEST_TIMEOUT = 300.0;
|
||||
size_t const ArangoClient::DEFAULT_RETRIES = 2;
|
||||
|
||||
double const ArangoClient::LONG_TIMEOUT = 86400.0;
|
||||
|
||||
namespace {
|
||||
#ifdef _WIN32
|
||||
bool _newLine () {
|
||||
|
@ -459,13 +461,19 @@ void ArangoClient::parse (ProgramOptions& options,
|
|||
if (_serverOptions) {
|
||||
|
||||
// check connection args
|
||||
if (_connectTimeout <= 0) {
|
||||
LOG_FATAL_AND_EXIT("invalid value for --server.connect-timeout, must be positive");
|
||||
if (_connectTimeout < 0.0) {
|
||||
LOG_FATAL_AND_EXIT("invalid value for --server.connect-timeout, must be >= 0");
|
||||
}
|
||||
else if (_connectTimeout == 0.0) {
|
||||
_connectTimeout = LONG_TIMEOUT;
|
||||
}
|
||||
|
||||
if (_requestTimeout <= 0) {
|
||||
if (_requestTimeout < 0.0) {
|
||||
LOG_FATAL_AND_EXIT("invalid value for --server.request-timeout, must be positive");
|
||||
}
|
||||
else if (_requestTimeout == 0.0) {
|
||||
_requestTimeout = LONG_TIMEOUT;
|
||||
}
|
||||
|
||||
// must specify a user name
|
||||
if (_username.size() == 0) {
|
||||
|
|
|
@ -87,6 +87,12 @@ namespace triagens {
|
|||
|
||||
static double const DEFAULT_CONNECTION_TIMEOUT;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief default "long" timeout
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static double const LONG_TIMEOUT;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief ignore sequence used for prompt length calculation (starting point)
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue