fix: logs

This commit is contained in:
lilong.129
2023-09-07 23:34:20 +08:00
parent 10ce6084d2
commit 0df3799e4d

View File

@@ -138,9 +138,9 @@ func (vc *VideoCrawler) startLiveCrawler(enterPoint PointF) error {
liveRoom, err := vc.getCurrentVideo() liveRoom, err := vc.getCurrentVideo()
if err != nil || liveRoom.Type != VideoType_Live { if err != nil || liveRoom.Type != VideoType_Live {
if vc.failedCount >= 5 { if vc.failedCount >= 3 {
// failed 5 consecutive times // failed 3 consecutive times
return errors.New("get current live event trackings failed 5 consecutive times") return errors.New("get current live event trackings failed 3 consecutive times")
} }
// retry // retry
vc.failedCount++ vc.failedCount++
@@ -342,9 +342,6 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
// simulation watch feed video // simulation watch feed video
sleepStrict(swipeFinishTime, screenResult.Video.PlayDuration) sleepStrict(swipeFinishTime, screenResult.Video.PlayDuration)
log.Warn().Interface("video", feedVideo).
Msg("get unexpected video type")
} }
screenResult.TotalElapsed = time.Since(swipeFinishTime).Milliseconds() screenResult.TotalElapsed = time.Since(swipeFinishTime).Milliseconds()
@@ -436,6 +433,7 @@ func (vc *VideoCrawler) getCurrentVideo() (video *Video, err error) {
} }
log.Info(). log.Info().
Str("type", string(video.Type)).
Interface("userName", video.UserName). Interface("userName", video.UserName).
Msg("get current video success") Msg("get current video success")
return video, nil return video, nil