minor regex checking
This commit is contained in:
parent
ec1743905a
commit
e9bd9b67cf
17
poll.go
17
poll.go
@ -113,7 +113,6 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) {
|
|||||||
ri_mutex.Lock()
|
ri_mutex.Lock()
|
||||||
runninginstances[endpoint] = m
|
runninginstances[endpoint] = m
|
||||||
ri_mutex.Unlock()
|
ri_mutex.Unlock()
|
||||||
log.Print("Failure here", err.Error())
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,17 +174,17 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) {
|
|||||||
for _, newpost := range newposts {
|
for _, newpost := range newposts {
|
||||||
go check_post(newpost.Uri)
|
go check_post(newpost.Uri)
|
||||||
matchset := re.FindStringSubmatch(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
|
// Only done if we are crawling
|
||||||
if newpost.Id > min_id {
|
go CheckInstance(newinstance, endpoint)
|
||||||
min_id = newpost.Id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only done if we are crawling
|
|
||||||
go CheckInstance(newinstance, endpoint)
|
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second * 10)
|
time.Sleep(time.Second * 10)
|
||||||
}
|
}
|
||||||
|
@ -92,9 +92,10 @@ func StreamMastodon(endpoint string, o *RunningInstance) {
|
|||||||
go check_post(newpost.Uri)
|
go check_post(newpost.Uri)
|
||||||
|
|
||||||
matchset := re.FindStringSubmatch(newpost.Uri)
|
matchset := re.FindStringSubmatch(newpost.Uri)
|
||||||
newinstance := matchset[1]
|
if matchset != nil {
|
||||||
|
newinstance := matchset[1]
|
||||||
go CheckInstance(newinstance, endpoint)
|
go CheckInstance(newinstance, endpoint)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if retry == true {
|
if retry == true {
|
||||||
time.Sleep(time.Minute * 30)
|
time.Sleep(time.Minute * 30)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user