diff --git a/nun.go b/nun.go index 6a14ba4..62e1d0c 100644 --- a/nun.go +++ b/nun.go @@ -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()