Refine time usage

This commit is contained in:
风扇滑翔翼
2025-09-10 04:56:41 +00:00
committed by GitHub
parent 033d2ba2b9
commit f42a518bf6
5 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -7,7 +7,6 @@ import (
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/proxy/vmess"
xtime "github.com/xtls/xray-core/proxy/vmess/time"
)
func (h *Handler) handleSwitchAccount(cmd *protocol.CommandSwitchAccount) {
@@ -26,7 +25,7 @@ func (h *Handler) handleSwitchAccount(cmd *protocol.CommandSwitchAccount) {
Account: account,
}
dest := net.TCPDestination(cmd.Host, cmd.Port)
until := xtime.Now().Add(time.Duration(cmd.ValidMin) * time.Minute)
until := time.Now().Add(time.Duration(cmd.ValidMin) * time.Minute)
h.serverList.AddServer(protocol.NewServerSpec(dest, protocol.BeforeTime(until), user))
}