add limiter config

This commit is contained in:
Yuzuki616
2025-02-18 09:52:48 +09:00
parent f3551df1ca
commit 55f9b28869
3 changed files with 37 additions and 0 deletions

View File

@@ -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{