Selaa lähdekoodia

调整下注时间

solupro 5 vuotta sitten
vanhempi
commit
02639cfabb
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 2 2
      eos.go
  2. 2 2
      runner.go

+ 2 - 2
eos.go

@@ -55,7 +55,7 @@ func gameReport(player string, trxId string, blockNum int) {
 
 	resp, err := h.PostForm(api, v)
 	if err != nil {
-		logrus.Warnf("bot:%s, trxId:%s, blockNum:%d report request error: %s", player, trxId, blockNum, err.Error())
+		logrus.WithField("error", err.Error()).Errorf("bot:%s, trxId:%s, blockNum:%d report request error", player, trxId, blockNum)
 	}
 	defer resp.Body.Close()
 
@@ -66,7 +66,7 @@ func gameReport(player string, trxId string, blockNum int) {
 	if respData.Result == 1 {
 		logrus.Infof("bot:%s, trxId:%s, blockNum:%d report success", player, trxId, blockNum)
 	} else {
-		logrus.Warnf("bot:%s, trxId:%s, blockNum:%d report error: %s", player, trxId, blockNum, respData.Msg)
+		logrus.WithField("error", respData.Msg).Errorf("bot:%s, trxId:%s, blockNum:%d report report error", player, trxId, blockNum)
 	}
 }
 

+ 2 - 2
runner.go

@@ -73,8 +73,6 @@ func worker(bot Account, botCh chan<- Account) {
 	logrus.Infof("bot: %s running~", bot.Player)
 	atomic.AddInt64(&Working, 1)
 	for {
-		rand.Seed(time.Now().UnixNano())
-		c := rand.Intn(51) + 30
 
 		err := Transfer(bot.Player, bot.StarId)
 		if err != nil { // 下注失败退出
@@ -82,6 +80,8 @@ func worker(bot Account, botCh chan<- Account) {
 			break
 		}
 
+		rand.Seed(time.Now().UnixNano())
+		c := rand.Intn(6) + 15
 		time.Sleep(time.Duration(c) * time.Second)
 	}