diff options
author | 2024-07-24 09:41:43 +0100 | |
---|---|---|
committer | 2024-07-24 10:41:43 +0200 | |
commit | 63fc9b6c3e8a03010b662a4acad0eb6f04a11f04 (patch) | |
tree | f4bf28f78333365cbe9eeda19de4de566e475584 /internal/db/bundb/interaction.go | |
parent | [feature] Allow user to set "bot" flag; show bot icon on profile (#3135) (diff) | |
download | gotosocial-63fc9b6c3e8a03010b662a4acad0eb6f04a11f04.tar.xz |
[chore] renames the `GTS` caches to `DB` caches (#3127)
* renames the `GTS` caches to `DB` caches, as it better references what they are
* change remaining Caches.GTS uses to Caches.DB
Diffstat (limited to 'internal/db/bundb/interaction.go')
-rw-r--r-- | internal/db/bundb/interaction.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/interaction.go b/internal/db/bundb/interaction.go index b818f7a60..2ded70311 100644 --- a/internal/db/bundb/interaction.go +++ b/internal/db/bundb/interaction.go @@ -73,7 +73,7 @@ func (r *interactionDB) getInteractionApproval( keyParts ...any, ) (*gtsmodel.InteractionApproval, error) { // Fetch approval from database cache with loader callback - approval, err := r.state.Caches.GTS.InteractionApproval.LoadOne(lookup, func() (*gtsmodel.InteractionApproval, error) { + approval, err := r.state.Caches.DB.InteractionApproval.LoadOne(lookup, func() (*gtsmodel.InteractionApproval, error) { var approval gtsmodel.InteractionApproval // Not cached! Perform database query @@ -132,14 +132,14 @@ func (r *interactionDB) PopulateInteractionApproval(ctx context.Context, approva } func (r *interactionDB) PutInteractionApproval(ctx context.Context, approval *gtsmodel.InteractionApproval) error { - return r.state.Caches.GTS.InteractionApproval.Store(approval, func() error { + return r.state.Caches.DB.InteractionApproval.Store(approval, func() error { _, err := r.db.NewInsert().Model(approval).Exec(ctx) return err }) } func (r *interactionDB) DeleteInteractionApprovalByID(ctx context.Context, id string) error { - defer r.state.Caches.GTS.InteractionApproval.Invalidate("ID", id) + defer r.state.Caches.DB.InteractionApproval.Invalidate("ID", id) _, err := r.db.NewDelete(). TableExpr("? AS ?", bun.Ident("interaction_approvals"), bun.Ident("interaction_approval")). |