diff --git a/poll.go b/poll.go index 3c4ea3d..929bd77 100644 --- a/poll.go +++ b/poll.go @@ -113,7 +113,6 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) { ri_mutex.Lock() runninginstances[endpoint] = m ri_mutex.Unlock() - log.Print("Failure here", err.Error()) return } @@ -175,17 +174,17 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) { for _, newpost := range newposts { go check_post(newpost.Uri) matchset := re.FindStringSubmatch(newpost.Uri) - newinstance := matchset[1] + if matchset != nil { + newinstance := matchset[1] - log.Print(newinstance + " reported by " + endpoint) + // Check min_id + if newpost.Id > min_id { + min_id = newpost.Id + } - // Check min_id - if newpost.Id > min_id { - min_id = newpost.Id + // Only done if we are crawling + go CheckInstance(newinstance, endpoint) } - - // Only done if we are crawling - go CheckInstance(newinstance, endpoint) } time.Sleep(time.Second * 10) } diff --git a/stream.go b/stream.go index ac9ab8e..f60260e 100644 --- a/stream.go +++ b/stream.go @@ -92,9 +92,10 @@ func StreamMastodon(endpoint string, o *RunningInstance) { go check_post(newpost.Uri) matchset := re.FindStringSubmatch(newpost.Uri) - newinstance := matchset[1] - - go CheckInstance(newinstance, endpoint) + if matchset != nil { + newinstance := matchset[1] + go CheckInstance(newinstance, endpoint) + } } if retry == true { time.Sleep(time.Minute * 30)