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.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/internal/db/bundb/tombstone.go b/internal/db/bundb/tombstone.go
index 393b2e356..668bde1af 100644
--- a/internal/db/bundb/tombstone.go
+++ b/internal/db/bundb/tombstone.go
@@ -67,16 +67,12 @@ func (t *tombstoneDB) PutTombstone(ctx context.Context, tombstone *gtsmodel.Tomb
}
func (t *tombstoneDB) DeleteTombstone(ctx context.Context, id string) db.Error {
- if _, err := t.conn.
- NewDelete().
+ defer t.state.Caches.GTS.Tombstone().Invalidate("ID", id)
+
+ // Delete tombstone from DB.
+ _, err := t.conn.NewDelete().
TableExpr("? AS ?", bun.Ident("tombstones"), bun.Ident("tombstone")).
Where("? = ?", bun.Ident("tombstone.id"), id).
- Exec(ctx); err != nil {
- return t.conn.ProcessError(err)
- }
-
- // Invalidate from cache by ID
- t.state.Caches.GTS.Tombstone().Invalidate("ID", id)
-
- return nil
+ Exec(ctx)
+ return t.conn.ProcessError(err)
}