From 06f5c8e2b7ca1fdeb472de53de91dd153c959a7c Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 9 Nov 2016 09:53:29 +0800 Subject: [PATCH] Fix #754 - "-heart" option for EMQ 2.0 --- etc/emq.conf | 7 ++++--- priv/emq.schema | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/etc/emq.conf b/etc/emq.conf index eda64ec2b..fd615c227 100644 --- a/etc/emq.conf +++ b/etc/emq.conf @@ -11,9 +11,10 @@ node.cookie = emq_dist_cookie ## SMP support: enable, auto, disable node.smp = auto -## TODO: -heart Heartbeat monitoring of an Erlang runtime system -## Values: on | off -## node.heartbeat = off +## vm.args: -heart +## Heartbeat monitoring of an Erlang runtime system +## Value should be 'on' or comment the line +## node.heartbeat = on ## Enable kernel poll node.kernel_poll = on diff --git a/priv/emq.schema b/priv/emq.schema index 71306e6e2..12113f14b 100644 --- a/priv/emq.schema +++ b/priv/emq.schema @@ -24,10 +24,17 @@ %% @doc http://erlang.org/doc/man/heart.html {mapping, "node.heartbeat", "vm_args.-heart", [ - {datatype, {enum, [enable, auto, disable]}}, + {datatype, flag}, hidden ]}. +{translation, "vm_args.-heart", fun(Conf) -> + case cuttlefish:conf_get("node.heartbeat", Conf) of + true -> ""; + false -> cuttlefish:invalid("should be 'on' or comment the line!") + end +end}. + %% @doc Enable Kernel Poll {mapping, "node.kernel_poll", "vm_args.+K", [ {default, on},