From 6afcd70776ace1ab51d55fabeeed5e3d5b64f698 Mon Sep 17 00:00:00 2001 From: schopenhauerz Date: Tue, 5 Sep 2023 18:36:15 +0800 Subject: [PATCH] Make it done when Push to the notify channel if given make sure it done,Push to the notify channel if given when shutdown sign arrvied. --- raft.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/raft.go b/raft.go index 98fe7044..2014ab30 100644 --- a/raft.go +++ b/raft.go @@ -434,6 +434,11 @@ func (r *Raft) runLeader() { select { case notify <- true: case <-r.shutdownCh: + // make sure push to the notify channel ( if given ) + select { + case notify <- true: + default: + } } }