diff --git a/cmd/dispatcher/state.go b/cmd/dispatcher/state.go index a623471..1212282 100644 --- a/cmd/dispatcher/state.go +++ b/cmd/dispatcher/state.go @@ -188,8 +188,11 @@ func (state *State) UpdateThread() { inflightsSum := int64(0) inflightsCount := 0 for _, t := range targets { - inflightsSum = inflightsSum + t.Inflight - inflightsCount = inflightsCount + 1 + // Only count targets that can actually handle inbound in this calculation. + if t.FreeSpace > int64(t.Target.MinimumFreeSpace) { + inflightsSum = inflightsSum + t.Inflight + inflightsCount = inflightsCount + 1 + } } averageInflights := float64(inflightsSum) / float64(inflightsCount) log.Debugf("Average inflights: %v", averageInflights)