From 36c277c3cedc80a1e147c6381ee85b01add93c20 Mon Sep 17 00:00:00 2001 From: eson Date: Tue, 15 Sep 2020 10:39:34 +0800 Subject: [PATCH] fix: update_interval = 0 if that is error --- extractor/twitch_extractor/tiwtch_extractor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extractor/twitch_extractor/tiwtch_extractor.go b/extractor/twitch_extractor/tiwtch_extractor.go index a1eedc9..f502479 100644 --- a/extractor/twitch_extractor/tiwtch_extractor.go +++ b/extractor/twitch_extractor/tiwtch_extractor.go @@ -189,9 +189,11 @@ func main() { for _, streamer := range streamers { Extractor(wd, streamer) + streamer.UpdateTime = &sql.NullTime{Time: time.Now(), Valid: true} if err = intimate.TStreamer.InsertOrUpdate(streamer, intimate.DUpdate{Field: "tags"}, intimate.DUpdate{Field: "update_time"}, + intimate.DUpdate{Field: "update_interval"}, ); err != nil { log.Println(err) } @@ -254,13 +256,15 @@ func Extractor(wd selenium.WebDriver, streamer *intimate.Streamer) { if err == nil { log.Println(*streamer.UserId, "may be cancell") streamer.Operator = 5 - streamer.UpdateTime = &sql.NullTime{Time: time.Now(), Valid: true} intimate.TStreamer.UpdateError(streamer, fmt.Errorf(*streamer.UserId, "may be cancell")) } return } err = extractFollowers(wd, clog) if err != nil { + // log.Println(err) + streamer.UpdateInterval += 30 + return }