Browse Source

超时时间修改

erlArango_http
maike 4 years ago
parent
commit
b167926e25
4 changed files with 6 additions and 6 deletions
  1. +1
    -1
      README.md
  2. +1
    -1
      src/agHttpCli/agHttpCli.erl
  3. +2
    -2
      src/agHttpCli/agSslAgencyIns.erl
  4. +2
    -2
      src/agHttpCli/agTcpAgencyIns.erl

+ 1
- 1
README.md View File

@ -30,7 +30,7 @@
Make a connection first Make a connection first
{ok, Socket} = agHttpCli:connect([]). %% Use default Settings {ok, Socket} = agHttpCli:connect([]). %% Use default Settings
%% Then you can then call various apis using Socket as the first argument %% Then you can then call various apis using Socket as the first argument
agMgrDb:curDbInfo(S).
agMgrDb:curDbInfo(Socket).
Connection pooling mode Connection pooling mode
application:ensure_all_started(erlArango). %% start app application:ensure_all_started(erlArango). %% start app

+ 1
- 1
src/agHttpCli/agHttpCli.erl View File

@ -66,7 +66,7 @@ castAgency(PoolNameOrSocket, Method, Path, Headers, Body, Pid, IsSystem, Timeout
case Timeout of case Timeout of
infinity -> infinity; infinity -> infinity;
_ -> _ ->
erlang:system_time(millisecond) + Timeout
erlang:monotonic_time(millisecond) + Timeout
end, end,
case erlang:is_atom(PoolNameOrSocket) of case erlang:is_atom(PoolNameOrSocket) of
true -> true ->

+ 2
- 2
src/agHttpCli/agSslAgencyIns.erl View File

@ -183,7 +183,7 @@ overAllWork(SrvState, #cliState{requestsIns = RequestsIns, requestsOuts = Reques
overDealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem}, overDealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem},
#srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState, #srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState,
#cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) -> #cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) ->
case erlang:system_time(millisecond) > OverTime of
case erlang:monotonic_time(millisecond) > OverTime of
true -> true ->
%% %%
agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}), agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}),
@ -359,7 +359,7 @@ dealConnect(ServerName, HostName, Port, SocketOptions) ->
dealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem}, dealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem},
#srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState, #srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState,
#cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) -> #cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) ->
case erlang:system_time(millisecond) > OverTime of
case erlang:monotonic_time(millisecond) > OverTime of
true -> true ->
%% %%
agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}), agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}),

+ 2
- 2
src/agHttpCli/agTcpAgencyIns.erl View File

@ -182,7 +182,7 @@ overAllWork(SrvState, #cliState{requestsIns = RequestsIns, requestsOuts = Reques
overDealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem}, overDealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem},
#srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState, #srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState,
#cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) -> #cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) ->
case erlang:system_time(millisecond) > OverTime of
case erlang:monotonic_time(millisecond) > OverTime of
true -> true ->
%% %%
agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}), agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}),
@ -358,7 +358,7 @@ dealConnect(ServerName, HostName, Port, SocketOptions) ->
dealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem}, dealQueueRequest(#miRequest{method = Method, path = Path, headers = Headers, body = Body, requestId = RequestId, fromPid = FromPid, overTime = OverTime, isSystem = IsSystem},
#srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState, #srvState{serverName = ServerName, host = Host, userPassWord = UserPassWord, dbName = DbName, socket = Socket} = SrvState,
#cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) -> #cliState{requestsIns = RequestsIns, requestsOuts = RequestsOuts, backlogNum = BacklogNum} = CliState) ->
case erlang:system_time(millisecond) > OverTime of
case erlang:monotonic_time(millisecond) > OverTime of
true -> true ->
%% %%
agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}), agAgencyUtils:agencyReply(FromPid, RequestId, undefined, {error, timeout}),

Loading…
Cancel
Save