fix: update_interval = 0 if that is error
This commit is contained in:
parent
072468005c
commit
36c277c3ce
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user