From 003de16e2bbe4412d88a433369e05e82d78b9f84 Mon Sep 17 00:00:00 2001 From: Farhan Khan Date: Thu, 3 Dec 2020 17:23:52 -0500 Subject: [PATCH] checking for crawling boolean --- poll/instance.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/poll/instance.go b/poll/instance.go index 5a44175..1b1352c 100644 --- a/poll/instance.go +++ b/poll/instance.go @@ -149,16 +149,20 @@ func PollMastodonPleroma(endpoint string, reportPostChan chan ReportPost) { if newpost.Id > min_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) }