minor regex checking

This commit is contained in:
farhan 2021-01-10 21:47:08 +00:00
parent ec1743905a
commit e9bd9b67cf
2 changed files with 12 additions and 12 deletions

View File

@ -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,10 +174,9 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) {
for _, newpost := range newposts {
go check_post(newpost.Uri)
matchset := re.FindStringSubmatch(newpost.Uri)
if matchset != nil {
newinstance := matchset[1]
log.Print(newinstance + " reported by " + endpoint)
// Check min_id
if newpost.Id > min_id {
min_id = newpost.Id
@ -187,6 +185,7 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) {
// Only done if we are crawling
go CheckInstance(newinstance, endpoint)
}
}
time.Sleep(time.Second * 10)
}
}

View File

@ -92,10 +92,11 @@ func StreamMastodon(endpoint string, o *RunningInstance) {
go check_post(newpost.Uri)
matchset := re.FindStringSubmatch(newpost.Uri)
if matchset != nil {
newinstance := matchset[1]
go CheckInstance(newinstance, endpoint)
}
}
if retry == true {
time.Sleep(time.Minute * 30)
} else {