From 9af9f7a4a84fb98569fb5c3e6cf628814f2d7883 Mon Sep 17 00:00:00 2001 From: Basho Date: Wed, 18 Mar 2015 14:55:00 -0700 Subject: [PATCH] fix heartbeat bug by adding new pattern match and debug line --- src/riak_repl2_rtsource_conn.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/riak_repl2_rtsource_conn.erl b/src/riak_repl2_rtsource_conn.erl index f4740e06..a2491f78 100644 --- a/src/riak_repl2_rtsource_conn.erl +++ b/src/riak_repl2_rtsource_conn.erl @@ -480,6 +480,11 @@ schedule_heartbeat(State = #state{hb_interval_tref = undefined, TRef = erlang:send_after(timer:seconds(HBInterval), self(), send_heartbeat), State#state{hb_interval_tref = TRef}; +schedule_heartbeat(State = #state{hb_interval_tref = _TRef, + hb_interval = HBInterval}) when is_integer(HBInterval) -> + lager:debug("hb_interval_tref is not undefined when attempting to schedule new heartbeat."), + State; + schedule_heartbeat(State) -> lager:warning("Heartbeat is misconfigured and is not a valid integer."), State.