checking for crawling boolean

This commit is contained in:
farhan 2020-12-03 17:23:52 -05:00
parent d57dd47c56
commit 003de16e2b

View File

@ -149,16 +149,20 @@ func PollMastodonPleroma(endpoint string, reportPostChan chan ReportPost) {
if newpost.Id > min_id { if newpost.Id > min_id {
min_id = newpost.Id min_id = newpost.Id
} }
newinstance := newpost.Account.Acct[at_sign+1:]
ri_mutex.Lock()
_, exists := runninginstances[newinstance]
if exists == false {
m := RunningInstance{}
runninginstances[newinstance] = m
go StartInstance(newinstance, reportPostChan)
}
ri_mutex.Unlock() // Only done if we are crawling
if settings.Crawl == true {
newinstance := newpost.Account.Acct[at_sign+1:]
ri_mutex.Lock()
_, exists := runninginstances[newinstance]
if exists == false {
m := RunningInstance{}
runninginstances[newinstance] = m
go StartInstance(newinstance, reportPostChan)
}
ri_mutex.Unlock()
}
} }
time.Sleep(time.Second * 10) time.Sleep(time.Second * 10)
} }