Skip to content

Commit

Permalink
#50: 30s delay after delete to unblock everything else
Browse files Browse the repository at this point in the history
  • Loading branch information
gugray committed Mar 23, 2024
1 parent 3de12ca commit 2caaea0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/server/logic/feed_follower.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,15 @@ func (ff *feedFollower) loseWeight(acct *dal.Account) {
ff.logger.Errorf("Error getting follower count of feed: %s: %v", acct.Handle, err)
return
}
if followerCount == 0 {
ff.logger.Infof("Deleting account with 0 followers: %s", acct.Handle)
if err = ff.repo.BruteDeleteAccount(acct.Id); err != nil {
ff.logger.Errorf("Failed to brute-delete account: %s: %v", acct.Handle, err)
}
if followerCount != 0 {
return
}
ff.logger.Infof("Deleting account with 0 followers: %s", acct.Handle)
if err = ff.repo.BruteDeleteAccount(acct.Id); err != nil {
ff.logger.Errorf("Failed to brute-delete account: %s: %v", acct.Handle, err)
return
}
time.Sleep(30 * time.Second)
}

func (ff *feedFollower) updateDBSizeMetric() {
Expand Down

0 comments on commit 2caaea0

Please sign in to comment.