Logging + skipping blank accounts
This commit is contained in:
parent
79a27dbc4b
commit
3ae62454db
@ -212,6 +212,11 @@ func StartInstancePoll(instancereport InstanceReport, reportPostChan chan Report
|
||||
min_id := ""
|
||||
numposts := 0
|
||||
for _, newpost := range newposts {
|
||||
|
||||
if newpost.Account.Acct == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
posthash := sha1.New()
|
||||
|
||||
at_sign := strings.Index(newpost.Account.Acct, "@")
|
||||
@ -257,9 +262,9 @@ func StartInstancePoll(instancereport InstanceReport, reportPostChan chan Report
|
||||
func DeferPollRun(instancereport InstanceReport, runninginstances *[]RunningInstance, instanceReportChan chan InstanceReport, reportPostChan chan ReportPost) {
|
||||
|
||||
delay := 10
|
||||
if instancereport.status == 200 && instancereport.numposts <= 10 {
|
||||
if instancereport.status == RUNNING && instancereport.numposts <= 10 {
|
||||
delay = 10
|
||||
} else if instancereport.status == 200 && instancereport.numposts > 10 {
|
||||
} else if instancereport.status == RUNNING && instancereport.numposts > 10 {
|
||||
delay = 15
|
||||
} else if instancereport.status == 429 {
|
||||
delay = 30
|
||||
@ -331,7 +336,7 @@ func NewInstance(endpoint string, runninginstances *[]RunningInstance, instanceR
|
||||
func writePost(pool *pgxpool.Pool, reportpost ReportPost) {
|
||||
conn, err := pool.Acquire(context.Background())
|
||||
if err != nil {
|
||||
fmt.Println("Error acquiring connection:", err)
|
||||
log.Fatal("Error connecting to database:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer conn.Release()
|
||||
@ -352,7 +357,7 @@ func writePost(pool *pgxpool.Pool, reportpost ReportPost) {
|
||||
fmt.Println("Account URL: ", reportpost.Account.Url)
|
||||
fmt.Println(reportpost)
|
||||
fmt.Println("--------------------------")
|
||||
// os.Exit(1) // For now I want this to die and learn why it failed
|
||||
os.Exit(1) // For now I want this to die and learn why it failed
|
||||
return
|
||||
}
|
||||
|
||||
@ -369,7 +374,7 @@ func writePost(pool *pgxpool.Pool, reportpost ReportPost) {
|
||||
fmt.Println("account_id", accountid)
|
||||
fmt.Println("posthash: ", reportpost.posthash)
|
||||
fmt.Println("--------------------------")
|
||||
// os.Exit(1) // For now I want this to die and learn why it failed
|
||||
os.Exit(1) // For now I want this to die and learn why it failed
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user