diff options
author | Mike Wallace <mikewallace1979@googlemail.com> | 2014-08-20 15:26:01 +0100 |
---|---|---|
committer | Jay Doane <jaydoane@apache.org> | 2021-04-19 00:34:24 -0700 |
commit | 045692f03ba4852c70a7f976d1f871ed36455f30 (patch) | |
tree | a0ed02f35e5ecd31ba728c1ec4c5b325931ad438 | |
parent | 69defe2df57573e76d7df6816dd6639d36b5fa35 (diff) | |
download | couchdb-045692f03ba4852c70a7f976d1f871ed36455f30.tar.gz |
Run local checks via RPC
This commit changes the run functionality such that when checks
are run on the single-node they are called via RPC to the local
cluster node.
This resolves an issue where the file permissions check would run
using the escript user rather than the dbcore user in single-node
mode.
BugzID: 33731
-rw-r--r-- | src/weatherreport/src/weatherreport_runner.erl | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/weatherreport/src/weatherreport_runner.erl b/src/weatherreport/src/weatherreport_runner.erl index 1beb02e0e..8b98d82e3 100644 --- a/src/weatherreport/src/weatherreport_runner.erl +++ b/src/weatherreport/src/weatherreport_runner.erl @@ -31,13 +31,8 @@ %% @doc Run the supplied list of checks on the local node -spec run([Module::atom()]) -> [tuple()]. run(Checks) -> - lists:flatten(lists:foldl(fun(Mod, Acc) -> - Node = weatherreport_node:nodename(), - MessagesWithNode = lists:map(fun({Level, Module, Message}) -> - {Node, Level, Module, Message} - end, weatherreport_check:check(Mod, get_check_options())), - [MessagesWithNode | Acc] - end, [], Checks)). + weatherreport_node:can_connect(), + run(Checks, [weatherreport_node:nodename()]). %% @doc Run the supplied list of checks on the supplied list of cluster nodes -spec run([Module::atom()], [node()] | all) -> [tuple()]. |