This commit is contained in:
tsmethurst 2021-06-29 16:31:11 +02:00
commit 3f546e8b32
4 changed files with 36 additions and 36 deletions

View file

@ -47,11 +47,11 @@ type processor struct {
// New returns a new admin processor.
func New(db db.DB, tc typeutils.TypeConverter, mediaHandler media.Handler, fromClientAPI chan gtsmodel.FromClientAPI, config *config.Config, log *logrus.Logger) Processor {
return &processor{
tc: tc,
config: config,
mediaHandler: mediaHandler,
tc: tc,
config: config,
mediaHandler: mediaHandler,
fromClientAPI: fromClientAPI,
db: db,
log: log,
db: db,
log: log,
}
}

View file

@ -116,10 +116,10 @@ func (p *processor) initiateDomainBlockSideEffects(block *gtsmodel.DomainBlock)
// delete accounts through the normal account deletion system (which should also delete media + posts + remove posts from timelines)
limit := 20 // just select 20 accounts at a time so we don't nuke our DB/mem with one huge query
limit := 20 // just select 20 accounts at a time so we don't nuke our DB/mem with one huge query
var maxID string // this is initially an empty string so we'll start at the top of accounts list (sorted by ID)
selectAccountsLoop:
selectAccountsLoop:
for {
accounts, err := p.db.GetAccountsForInstance(block.Domain, maxID, limit)
if err != nil {
@ -143,7 +143,7 @@ func (p *processor) initiateDomainBlockSideEffects(block *gtsmodel.DomainBlock)
}
// if this is the last account in the slice, set the maxID appropriately for the next query
if i == len(accounts) -1 {
if i == len(accounts)-1 {
maxID = a.ID
}
}