Fix silly nodes report bug

This commit is contained in:
2025-10-29 15:35:05 +09:00
parent 7252ecd40b
commit c5349f5736
4 changed files with 1403 additions and 38 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
-copyright("Craig Everett <ceverett@tsuriai.jp>").
-license("MIT").
-export([connect/4, slowly_connect/4]).
-export([connect/4, connect_slowly/4]).
connect(Node = {Host, Port}, Request, From, Timeout) ->
@@ -206,7 +206,7 @@ read_hval(_, Received, _, _, _) ->
{error, headers}.
slowly_connect(Node, {get, Path}, From, Timeout) ->
connect_slowly(Node, {get, Path}, From, Timeout) ->
HttpOptions = [{connect_timeout, 3000}, {timeout, Timeout}],
URL = lists:flatten(url(Node, Path)),
Request = {URL, []},
@@ -217,7 +217,7 @@ slowly_connect(Node, {get, Path}, From, Timeout) ->
BAD -> {error, BAD}
end,
gen_server:reply(From, Result);
slowly_connect(Node, {post, Path, Payload}, From, Timeout) ->
connect_slowly(Node, {post, Path, Payload}, From, Timeout) ->
HttpOptions = [{connect_timeout, 3000}, {timeout, Timeout}],
URL = lists:flatten(url(Node, Path)),
Request = {URL, [], "application/json", Payload},