mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 23:32:24 -05:00
[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
This commit is contained in:
parent
325b4a2b4a
commit
63fc9b6c3e
39 changed files with 376 additions and 378 deletions
|
|
@ -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")).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue