summaryrefslogtreecommitdiff
path: root/internal/processing/admin/createdomainblock.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-10-04 17:50:29 +0200
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-10-04 17:52:14 +0200
commitc31f21904c10f304e40cfbcb9bab9b4099e15e95 (patch)
treec39d8abea23fc63df06c40031e39f1e57eef4788 /internal/processing/admin/createdomainblock.go
parent[chore] Normalize domain blocks to punycode (#873) (diff)
downloadgotosocial-c31f21904c10f304e40cfbcb9bab9b4099e15e95.tar.xz
[bugfix] Use background context instead of request context for async processing (#888)v0.5.2
Fixes an issue where async processing was not completing correctly. In particular this applies to side effects of domain blocks: while the domain block was being entered and enforced correctly, side effects like deleting accounts and updating the instance entry for the blocked instance were not. This fixes that :)
Diffstat (limited to 'internal/processing/admin/createdomainblock.go')
-rw-r--r--internal/processing/admin/createdomainblock.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/processing/admin/createdomainblock.go b/internal/processing/admin/createdomainblock.go
index fcc0cb480..690160150 100644
--- a/internal/processing/admin/createdomainblock.go
+++ b/internal/processing/admin/createdomainblock.go
@@ -75,7 +75,9 @@ func (p *processor) DomainBlockCreate(ctx context.Context, account *gtsmodel.Acc
block = &newBlock
// Process the side effects of the domain block asynchronously since it might take a while
- go p.initiateDomainBlockSideEffects(ctx, account, block)
+ go func() {
+ p.initiateDomainBlockSideEffects(context.Background(), account, block)
+ }()
}
// Convert our gts model domain block into an API model