reddit api worse then others, use longer wait and try again
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cd2cfc71cc
commit
5926c09585
9
nun.go
9
nun.go
@ -31,6 +31,11 @@ func (n *nunWatch) Main() {
|
|||||||
log.Fatal("fail count too high; ending loop")
|
log.Fatal("fail count too high; ending loop")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if n.fail > 3 {
|
||||||
|
log.Println("over three failures, increasing tick time to 5 minutes")
|
||||||
|
ticker.Reset(5 * time.Minute)
|
||||||
|
continue
|
||||||
|
}
|
||||||
newPost, err := getNewestPost("LittleNuns")
|
newPost, err := getNewestPost("LittleNuns")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error getting newest post: %v", err)
|
log.Printf("error getting newest post: %v", err)
|
||||||
@ -38,7 +43,11 @@ func (n *nunWatch) Main() {
|
|||||||
n.fail++
|
n.fail++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if n.fail != 0 {
|
||||||
n.fail = 0
|
n.fail = 0
|
||||||
|
ticker.Reset(30 * time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
if n.curPost.Title != newPost.Title {
|
if n.curPost.Title != newPost.Title {
|
||||||
n.curPost = newPost
|
n.curPost = newPost
|
||||||
roomResp, err := n.client.JoinedRooms()
|
roomResp, err := n.client.JoinedRooms()
|
||||||
|
Loading…
Reference in New Issue
Block a user