mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 07:43:01 -06: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
|
|
@ -158,7 +158,7 @@ func (m *moveDB) getMove(
|
|||
dbQuery func(*gtsmodel.Move) error,
|
||||
keyParts ...any,
|
||||
) (*gtsmodel.Move, error) {
|
||||
move, err := m.state.Caches.GTS.Move.LoadOne(lookup, func() (*gtsmodel.Move, error) {
|
||||
move, err := m.state.Caches.DB.Move.LoadOne(lookup, func() (*gtsmodel.Move, error) {
|
||||
var move gtsmodel.Move
|
||||
|
||||
// Not cached! Perform database query.
|
||||
|
|
@ -205,7 +205,7 @@ func (m *moveDB) PopulateMove(ctx context.Context, move *gtsmodel.Move) error {
|
|||
}
|
||||
|
||||
func (m *moveDB) PutMove(ctx context.Context, move *gtsmodel.Move) error {
|
||||
return m.state.Caches.GTS.Move.Store(move, func() error {
|
||||
return m.state.Caches.DB.Move.Store(move, func() error {
|
||||
_, err := m.db.
|
||||
NewInsert().
|
||||
Model(move).
|
||||
|
|
@ -222,7 +222,7 @@ func (m *moveDB) UpdateMove(ctx context.Context, move *gtsmodel.Move, columns ..
|
|||
columns = append(columns, "updated_at")
|
||||
}
|
||||
|
||||
return m.state.Caches.GTS.Move.Store(move, func() error {
|
||||
return m.state.Caches.DB.Move.Store(move, func() error {
|
||||
_, err := m.db.
|
||||
NewUpdate().
|
||||
Model(move).
|
||||
|
|
@ -234,7 +234,7 @@ func (m *moveDB) UpdateMove(ctx context.Context, move *gtsmodel.Move, columns ..
|
|||
}
|
||||
|
||||
func (m *moveDB) DeleteMoveByID(ctx context.Context, id string) error {
|
||||
defer m.state.Caches.GTS.Move.Invalidate("ID", id)
|
||||
defer m.state.Caches.DB.Move.Invalidate("ID", id)
|
||||
|
||||
_, err := m.db.
|
||||
NewDelete().
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue