From a8c45e02dd16f070708ac207c04ee8a036abffb7 Mon Sep 17 00:00:00 2001 From: chrislu Date: Mon, 17 Nov 2025 21:08:48 -0800 Subject: [PATCH] simplify --- weed/storage/store.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weed/storage/store.go b/weed/storage/store.go index 064e7086f..cc07f8702 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -295,9 +295,8 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat { effectiveMaxCount := location.MaxVolumeCount if location.isDiskSpaceLow { usedSlots := int32(location.LocalVolumesLen()) - if ecShardCount := location.EcShardCount(); ecShardCount > 0 { - usedSlots += int32((ecShardCount + erasure_coding.DataShardsCount - 1) / erasure_coding.DataShardsCount) - } + ecShardCount := location.EcShardCount() + usedSlots += int32((ecShardCount + erasure_coding.DataShardsCount - 1) / erasure_coding.DataShardsCount) effectiveMaxCount = usedSlots } if effectiveMaxCount < 0 {