summaryrefslogtreecommitdiff
path: root/internal/db/bundb/tombstone.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/tombstone.go')
-rw-r--r--internal/db/bundb/tombstone.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/db/bundb/tombstone.go b/internal/db/bundb/tombstone.go
index bff4ad839..773702323 100644
--- a/internal/db/bundb/tombstone.go
+++ b/internal/db/bundb/tombstone.go
@@ -67,12 +67,14 @@ func (t *tombstoneDB) PutTombstone(ctx context.Context, tombstone *gtsmodel.Tomb
}
func (t *tombstoneDB) DeleteTombstone(ctx context.Context, id string) error {
- defer t.state.Caches.DB.Tombstone.Invalidate("ID", id)
-
// Delete tombstone from DB.
_, err := t.db.NewDelete().
TableExpr("? AS ?", bun.Ident("tombstones"), bun.Ident("tombstone")).
Where("? = ?", bun.Ident("tombstone.id"), id).
Exec(ctx)
+
+ // Invalidate any cached tombstone by given ID.
+ t.state.Caches.DB.Tombstone.Invalidate("ID", id)
+
return err
}