From 232e3cf7cccd801f9f8e0e59c313cd117f78f528 Mon Sep 17 00:00:00 2001 From: flswld Date: Sun, 14 May 2023 20:42:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot/cmd/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/robot/cmd/main.go b/robot/cmd/main.go index 7daf344b..44e3b613 100644 --- a/robot/cmd/main.go +++ b/robot/cmd/main.go @@ -53,11 +53,12 @@ func main() { } if config.GetConfig().Hk4eRobot.DosEnable { - for i := 0; i < int(config.GetConfig().Hk4eRobot.DosTotalNum); i++ { + dosBatchNum := int(config.GetConfig().Hk4eRobot.DosBatchNum) + for i := 0; i < int(config.GetConfig().Hk4eRobot.DosTotalNum); i += dosBatchNum { wg := new(sync.WaitGroup) - wg.Add(int(config.GetConfig().Hk4eRobot.DosBatchNum)) - for j := 0; j < int(config.GetConfig().Hk4eRobot.DosBatchNum); j++ { - go httpLogin(config.GetConfig().Hk4eRobot.Account+"_"+strconv.Itoa(i), dispatchInfo, wg) + wg.Add(dosBatchNum) + for j := 0; j < dosBatchNum; j++ { + go httpLogin(config.GetConfig().Hk4eRobot.Account+"_"+strconv.Itoa(i+j), dispatchInfo, wg) } wg.Wait() }