mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 14:02:25 -05:00
replace async client API / federator msg processing with worker pools (#497)
* replace async client API / federator msg processing with worker pools * appease our lord-and-saviour, the linter
This commit is contained in:
parent
cc5f2e98b7
commit
420e2fb22b
64 changed files with 573 additions and 336 deletions
|
|
@ -159,13 +159,13 @@ selectStatusesLoop:
|
|||
// pass the status delete through the client api channel for processing
|
||||
s.Account = account
|
||||
l.Debug("putting status in the client api channel")
|
||||
p.fromClientAPI <- messages.FromClientAPI{
|
||||
p.clientWorker.Queue(messages.FromClientAPI{
|
||||
APObjectType: ap.ObjectNote,
|
||||
APActivityType: ap.ActivityDelete,
|
||||
GTSModel: s,
|
||||
OriginAccount: account,
|
||||
TargetAccount: account,
|
||||
}
|
||||
})
|
||||
|
||||
if err := p.db.DeleteByID(ctx, s.ID, s); err != nil {
|
||||
if err != db.ErrNoEntries {
|
||||
|
|
@ -195,13 +195,13 @@ selectStatusesLoop:
|
|||
}
|
||||
|
||||
l.Debug("putting boost undo in the client api channel")
|
||||
p.fromClientAPI <- messages.FromClientAPI{
|
||||
p.clientWorker.Queue(messages.FromClientAPI{
|
||||
APObjectType: ap.ActivityAnnounce,
|
||||
APActivityType: ap.ActivityUndo,
|
||||
GTSModel: s,
|
||||
OriginAccount: b.Account,
|
||||
TargetAccount: account,
|
||||
}
|
||||
})
|
||||
|
||||
if err := p.db.DeleteByID(ctx, b.ID, b); err != nil {
|
||||
if err != db.ErrNoEntries {
|
||||
|
|
@ -331,7 +331,7 @@ func (p *processor) DeleteLocal(ctx context.Context, account *gtsmodel.Account,
|
|||
}
|
||||
|
||||
// put the delete in the processor queue to handle the rest of it asynchronously
|
||||
p.fromClientAPI <- fromClientAPIMessage
|
||||
p.clientWorker.Queue(fromClientAPIMessage)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue