From ea4eb7301bb237773a9ae2d7b8c5c6cd570499a0 Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Wed, 20 Dec 2017 14:51:10 -0800 Subject: [PATCH] scorch merger checks closeCh --- index/scorch/merge.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index/scorch/merge.go b/index/scorch/merge.go index cc3af774..35469d59 100644 --- a/index/scorch/merge.go +++ b/index/scorch/merge.go @@ -162,7 +162,11 @@ func (s *Scorch) planMergeAtSnapshot(ourSnapshot *IndexSnapshot) error { } } for _, notification := range notifications { - <-notification + select { + case <-s.closeCh: + return nil + case <-notification: + } } return nil }