mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-04 01:06:36 +08:00
fix(backend): correct speed limit unit conversion from Mbps to Bytes/s
This commit is contained in:
@@ -1045,7 +1045,10 @@ func buildForwardServiceConfigs(baseName string, forward *forwardRecord, tunnel
|
||||
service["metadata"] = map[string]interface{}{"interface": node.InterfaceName}
|
||||
}
|
||||
if limiter != nil && *limiter > 0 {
|
||||
service["limiter"] = strconv.Itoa(*limiter)
|
||||
// Convert Mbps to Bytes/s
|
||||
// 1 Mbps = 1,000,000 bits/s = 125,000 Bytes/s
|
||||
// We use decimal Mbps standard as is common in networking
|
||||
service["limiter"] = strconv.Itoa(*limiter * 125000)
|
||||
}
|
||||
services = append(services, service)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user