mirror of
https://github.com/GOSTSec/ccminer
synced 2025-03-13 05:51:19 +00:00
Restore default timeout (300s) for normal use
Was only useful to reduce pool switching problems but some pools require a longer value.
This commit is contained in:
parent
c9ef0b6b39
commit
736f916da3
@ -120,7 +120,7 @@ its command line interface and options.
|
||||
(default: retry indefinitely)
|
||||
-R, --retry-pause=N time to pause between retries, in seconds (default: 15)
|
||||
--time-limit maximum time [s] to mine before exiting the program.
|
||||
-T, --timeout=N network timeout, in seconds (default: 270)
|
||||
-T, --timeout=N network timeout, in seconds (default: 300)
|
||||
-s, --scantime=N upper bound on time spent scanning current work when
|
||||
long polling is unavailable, in seconds (default: 5)
|
||||
-n, --ndevs list cuda devices
|
||||
|
@ -184,7 +184,7 @@ static int opt_retries = -1;
|
||||
static int opt_fail_pause = 30;
|
||||
int opt_time_limit = -1;
|
||||
time_t firstwork_time = 0;
|
||||
int opt_timeout = 60; // curl
|
||||
int opt_timeout = 300; // curl
|
||||
int opt_scantime = 10;
|
||||
static json_t *opt_config;
|
||||
static const bool opt_time = true;
|
||||
@ -335,7 +335,7 @@ Options:\n\
|
||||
(default: retry indefinitely)\n\
|
||||
-R, --retry-pause=N time to pause between retries, in seconds (default: 30)\n\
|
||||
--time-limit maximum time [s] to mine before exiting the program.\n\
|
||||
-T, --timeout=N network timeout, in seconds (default: 60)\n\
|
||||
-T, --timeout=N network timeout, in seconds (default: 300)\n\
|
||||
-s, --scantime=N upper bound on time spent scanning current work when\n\
|
||||
long polling is unavailable, in seconds (default: 10)\n\
|
||||
-n, --ndevs list cuda devices\n\
|
||||
@ -2642,6 +2642,7 @@ void parse_arg(int key, char *arg)
|
||||
// change some defaults if multi pools
|
||||
if (opt_retries == -1) opt_retries = 1;
|
||||
if (opt_fail_pause == 30) opt_fail_pause = 5;
|
||||
if (opt_timeout == 300) opt_timeout = 60;
|
||||
}
|
||||
p = strstr(arg, "://");
|
||||
if (p) {
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
"algo" : "zr5",
|
||||
|
||||
"timeout": 60,
|
||||
|
||||
"api-bind" : "0.0.0.0",
|
||||
"api-remote" : true,
|
||||
|
||||
|
9
util.cpp
9
util.cpp
@ -404,7 +404,7 @@ static json_t *json_rpc_call(CURL *curl, const char *url,
|
||||
char *httpdata;
|
||||
char len_hdr[64], hashrate_hdr[64];
|
||||
char curl_err_str[CURL_ERROR_SIZE] = { 0 };
|
||||
long timeout = longpoll ? opt_timeout*2 : opt_timeout;
|
||||
long timeout = longpoll ? opt_timeout : opt_timeout/2;
|
||||
struct header_info hi = { 0 };
|
||||
bool lp_scanning = longpoll_scan && !have_longpoll;
|
||||
|
||||
@ -598,7 +598,7 @@ json_t *json_rpc_longpoll(CURL *curl, char *lp_url, struct pool_infos *pool, con
|
||||
strlen(pool->pass)?':':'\0', pool->pass);
|
||||
|
||||
// on pool rotate by time-limit, this keepalive can be a problem
|
||||
bool keepalive = pool->time_limit == 0 || pool->time_limit > opt_timeout*4;
|
||||
bool keepalive = pool->time_limit == 0 || pool->time_limit > opt_timeout;
|
||||
|
||||
return json_rpc_call(curl, lp_url, userpass, req, false, true, keepalive, curl_err);
|
||||
}
|
||||
@ -853,6 +853,7 @@ char *stratum_recv_line(struct stratum_ctx *sctx)
|
||||
{
|
||||
ssize_t len, buflen;
|
||||
char *tok, *sret = NULL;
|
||||
int timeout = opt_timeout;
|
||||
|
||||
if (!sctx->sockbuf)
|
||||
return NULL;
|
||||
@ -860,7 +861,7 @@ char *stratum_recv_line(struct stratum_ctx *sctx)
|
||||
if (!strstr(sctx->sockbuf, "\n")) {
|
||||
bool ret = true;
|
||||
time_t rstart = time(NULL);
|
||||
if (!socket_full(sctx->sock, opt_timeout)) {
|
||||
if (!socket_full(sctx->sock, timeout)) {
|
||||
applog(LOG_ERR, "stratum_recv_line timed out");
|
||||
goto out;
|
||||
}
|
||||
@ -881,7 +882,7 @@ char *stratum_recv_line(struct stratum_ctx *sctx)
|
||||
}
|
||||
} else
|
||||
stratum_buffer_append(sctx, s);
|
||||
} while (time(NULL) - rstart < opt_timeout && !strstr(sctx->sockbuf, "\n"));
|
||||
} while (time(NULL) - rstart < timeout && !strstr(sctx->sockbuf, "\n"));
|
||||
|
||||
if (!ret) {
|
||||
applog(LOG_ERR, "stratum_recv_line failed");
|
||||
|
Loading…
x
Reference in New Issue
Block a user