fix(blobstore): avoid unnecessary work for disabled codemodes

Signed-off-by: yuzhiqiang <yuzhiqiang_yewu@cmss.chinamobile.com>
This commit is contained in:
yuzhiqiang 2025-11-18 09:33:50 +08:00 committed by 梁曟風
parent b4a41d9007
commit 2912760ee5

View File

@ -337,12 +337,13 @@ func (v *volumeMgr) initModeInfo(ctx context.Context) (err error) {
return errors.Base(err, "json.Unmarshal code_mode policy err").Detail(err)
}
for _, codeModeConfig := range codeModeConfigInfos {
allocCh := make(chan *allocArgs)
codeMode := codeModeConfig.ModeName.GetCodeMode()
if !codeModeConfig.Enable {
continue
}
allocCh := make(chan *allocArgs)
codeMode := codeModeConfig.ModeName.GetCodeMode()
v.allocChs[codeMode] = allocCh
tactic := codeMode.Tactic()
threshold := float64(v.InitVolumeNum*tactic.N*volumeChunkSizeInt) * v.TotalThresholdRatio