mirror of
https://github.com/InazumaV/Ratte.git
synced 2026-02-04 04:30:09 +00:00
add limiter config
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/InazumaV/Ratte-Interface/core"
|
||||
"github.com/InazumaV/Ratte-Interface/panel"
|
||||
"github.com/InazumaV/Ratte/common/maps"
|
||||
"github.com/InazumaV/Ratte/common/number"
|
||||
)
|
||||
|
||||
func (h *Handler) PullNodeHandle(n *panel.NodeInfo) error {
|
||||
@@ -43,6 +44,8 @@ func (h *Handler) PullNodeHandle(n *panel.NodeInfo) error {
|
||||
}
|
||||
ni := (*core.NodeInfo)(n)
|
||||
ni.OtherOptions = maps.Merge[string, any](ni.OtherOptions, h.Options.Expand)
|
||||
ni.Limit.IPLimit = number.SelectBigger(ni.Limit.IPLimit, h.Limit.IPLimit)
|
||||
ni.Limit.SpeedLimit = number.SelectBigger(ni.Limit.SpeedLimit, int(h.Limit.SpeedLimit))
|
||||
err = h.c.AddNode(&core.AddNodeParams{
|
||||
NodeInfo: ni,
|
||||
TlsOptions: core.TlsOptions{
|
||||
|
||||
Reference in New Issue
Block a user