Commit af3a5076 authored by erio's avatar erio
Browse files

fix: add load_factor upper bound validation to BulkUpdateAccounts

parent 18f2e214
...@@ -1635,7 +1635,13 @@ func (s *adminServiceImpl) BulkUpdateAccounts(ctx context.Context, input *BulkUp ...@@ -1635,7 +1635,13 @@ func (s *adminServiceImpl) BulkUpdateAccounts(ctx context.Context, input *BulkUp
repoUpdates.RateMultiplier = input.RateMultiplier repoUpdates.RateMultiplier = input.RateMultiplier
} }
if input.LoadFactor != nil { if input.LoadFactor != nil {
repoUpdates.LoadFactor = input.LoadFactor if *input.LoadFactor <= 0 {
repoUpdates.LoadFactor = nil // 0 或负数表示清除
} else if *input.LoadFactor > 10000 {
return nil, errors.New("load_factor must be <= 10000")
} else {
repoUpdates.LoadFactor = input.LoadFactor
}
} }
if input.Status != "" { if input.Status != "" {
repoUpdates.Status = &input.Status repoUpdates.Status = &input.Status
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment