reddit api worse then others, use longer wait and try again
continuous-integration/drone/push Build is passing Details

This commit is contained in:
stryan 2022-07-18 11:20:29 -04:00
parent cd2cfc71cc
commit 5926c09585
1 changed files with 10 additions and 1 deletions

11
nun.go
View File

@ -31,6 +31,11 @@ func (n *nunWatch) Main() {
log.Fatal("fail count too high; ending loop")
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")
if err != nil {
log.Printf("error getting newest post: %v", err)
@ -38,7 +43,11 @@ func (n *nunWatch) Main() {
n.fail++
continue
}
n.fail = 0
if n.fail != 0 {
n.fail = 0
ticker.Reset(30 * time.Second)
}
if n.curPost.Title != newPost.Title {
n.curPost = newPost
roomResp, err := n.client.JoinedRooms()