From 2b1aeaaa7730767265b20bd87a3d2bbad5505cef Mon Sep 17 00:00:00 2001 From: eson Date: Wed, 9 Dec 2020 19:10:51 +0800 Subject: [PATCH] feat(shutdown): add cur loop break --- collect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collect.go b/collect.go index 6db8c97..0f1c1bb 100644 --- a/collect.go +++ b/collect.go @@ -43,7 +43,7 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) { continue } - for cur.Next(context.TODO()) { + for cur.Next(context.TODO()) && !ps.IsClose() { // la := &database.LiveAnchorsCountPoint{} la := &database.LiveAnchorsCountPointObjectID{} err = cur.Decode(la)