DESKTOP-HN5QP3V\Administrator 2 ヶ月 前
コミット
16660e7d81
3 ファイル変更4 行追加5 行削除
  1. 2 3
      app/service/subscribe.go
  2. 1 1
      pkg/sender/subscribe.go
  3. 1 1
      pkg/util/times.go

+ 2 - 3
app/service/subscribe.go

@@ -164,10 +164,9 @@ func (this *SubscribeTaskService) Task() error {
 	default:
 		return errors.New("unknown module")
 	}
-
-	this.Timestamp = util.GetNowSecond() + 5*1000
+	
 	if this.Status {
-		logger.Info("Subscribe task append key %s, device id %s duration %d", key, this.DeviceId, this.Timestamp/1000)
+		logger.Info("Subscribe task append key %s, device id %s timestamp %d, task_time %s", key, this.DeviceId, this.Timestamp, util.TimeStr2DateTime(this.Timestamp, util.TimeLayout))
 		task.SubscribeTask.Append(key, this.DeviceId, this.Timestamp, this.Module)
 	} else {
 		task.SubscribeTask.Remove(key)

+ 1 - 1
pkg/sender/subscribe.go

@@ -79,7 +79,7 @@ func (this *SubscribeSender) safeSend(send *SubscribeSend) {
 	case "hangup":
 		this.SendHangupSubscribe(send.DeviceId)
 	case "autofight":
-		this.SendHangupSubscribe(send.DeviceId)
+		this.SendAutoFightSubscribe(send.DeviceId)
 	case "guildgame":
 		this.SendGuildGameSubscribe(send.OpenIds)
 	case "alliance":

+ 1 - 1
pkg/util/times.go

@@ -11,7 +11,7 @@ func DateTime2TimeStr(datatime string) int64 {
 }
 
 func TimeStr2DateTime(timestr int64, format string) string {
-	return time.Unix(timestr, 0).Format(format)
+	return time.UnixMilli(timestr).Format(format)
 }
 
 // 获取相差时间(小时)