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 {
|
for _, streamer := range streamers {
|
||||||
Extractor(wd, streamer)
|
Extractor(wd, streamer)
|
||||||
|
streamer.UpdateTime = &sql.NullTime{Time: time.Now(), Valid: true}
|
||||||
if err = intimate.TStreamer.InsertOrUpdate(streamer,
|
if err = intimate.TStreamer.InsertOrUpdate(streamer,
|
||||||
intimate.DUpdate{Field: "tags"},
|
intimate.DUpdate{Field: "tags"},
|
||||||
intimate.DUpdate{Field: "update_time"},
|
intimate.DUpdate{Field: "update_time"},
|
||||||
|
intimate.DUpdate{Field: "update_interval"},
|
||||||
); err != nil {
|
); err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
@ -254,13 +256,15 @@ func Extractor(wd selenium.WebDriver, streamer *intimate.Streamer) {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Println(*streamer.UserId, "may be cancell")
|
log.Println(*streamer.UserId, "may be cancell")
|
||||||
streamer.Operator = 5
|
streamer.Operator = 5
|
||||||
streamer.UpdateTime = &sql.NullTime{Time: time.Now(), Valid: true}
|
|
||||||
intimate.TStreamer.UpdateError(streamer, fmt.Errorf(*streamer.UserId, "may be cancell"))
|
intimate.TStreamer.UpdateError(streamer, fmt.Errorf(*streamer.UserId, "may be cancell"))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = extractFollowers(wd, clog)
|
err = extractFollowers(wd, clog)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// log.Println(err)
|
||||||
|
streamer.UpdateInterval += 30
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user