Bläddra i källkod

d03 Исправление тупых ошибок

SVI 2 år sedan
förälder
incheckning
a2d47ee06a

+ 1 - 1
Makefile

@@ -20,7 +20,7 @@ runner.build:
 serv.run:
 	clear
 	go fmt ./...
-	go build -o ./bin/dev_serv ./cmd/server/main.go
+	go build -o ./bin/wartank_dev ./cmd/server/main.go
 	./dev_serv.sh
 test.run:
 	clear

+ 8 - 0
cmd/server/main.go

@@ -2,15 +2,23 @@
 //
 //	Команда запуска обновлятора noip.com
 //	noip-duc -g p78su.ddns.net,p78git.ddns.net --daemonize -u prospero78su -p Lera_07091978
+//
+// Профилирование:
+//
+//	go tool pprof http://localhost:8080/debug/pprof/profile?seconds=30
 package main
 
 import (
 	"log"
+	"net/http"
+	_ "net/http/pprof"
 	"os"
+
 	"wartank/server"
 )
 
 func main() {
+	go http.ListenAndServe("0.0.0.0:8080", nil)
 	serv, err := server.NewServer()
 	if err != nil {
 		log.Printf("main(): in make IServer, err=\n\t%v\n", err)

+ 1 - 1
dev_serv.sh

@@ -3,4 +3,4 @@ export SERVER_HTTP_PORT=":18060"
 
 
 cd ./bin && \
-./dev_serv
+./wartank_dev

+ 2 - 1
server/serv_bots/warbot/angar/base/arsenal/arsenal.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"strconv"
 	"strings"
+	"time"
 
 	"wartank/pkg/components/section"
 	"wartank/pkg/types"
@@ -92,7 +93,7 @@ func (sf *Арсенал) run() {
 			// }
 			sf.makeArsenal()
 		}
-		// time.Sleep(time.Second * 30)
+		time.Sleep(time.Second * 10)
 	}
 }
 

+ 2 - 0
server/serv_bots/warbot/angar/base/bank/bank.go

@@ -5,6 +5,7 @@ import (
 	"log"
 	"strconv"
 	"strings"
+	"time"
 
 	"wartank/pkg/components/section"
 	"wartank/pkg/types"
@@ -82,6 +83,7 @@ func (sf *Bank) run() {
 			continue
 		}
 		sf.Section.SetCountDown(iTime)
+		time.Sleep(time.Second * 10)
 	}
 }
 

+ 2 - 0
server/serv_bots/warbot/angar/batmas/batmas.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"log"
 	"strings"
+	"time"
 
 	"wartank/pkg/components/section"
 	"wartank/pkg/types"
@@ -53,6 +54,7 @@ func (sf *BatMas) Run() error {
 	_ = sf.goBatMas()
 	go func() {
 		for {
+			time.Sleep(time.Second * 10)
 			select {
 			case <-sf.bot.Кнт().Done():
 				sf.ВремяОпрос().Стоп()