mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-23 12:12:56 -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
|
|
@ -32,7 +32,7 @@ type tombstoneDB struct {
|
|||
}
|
||||
|
||||
func (t *tombstoneDB) GetTombstoneByURI(ctx context.Context, uri string) (*gtsmodel.Tombstone, error) {
|
||||
return t.state.Caches.GTS.Tombstone.LoadOne("URI", func() (*gtsmodel.Tombstone, error) {
|
||||
return t.state.Caches.DB.Tombstone.LoadOne("URI", func() (*gtsmodel.Tombstone, error) {
|
||||
var tomb gtsmodel.Tombstone
|
||||
|
||||
q := t.db.
|
||||
|
|
@ -57,7 +57,7 @@ func (t *tombstoneDB) TombstoneExistsWithURI(ctx context.Context, uri string) (b
|
|||
}
|
||||
|
||||
func (t *tombstoneDB) PutTombstone(ctx context.Context, tombstone *gtsmodel.Tombstone) error {
|
||||
return t.state.Caches.GTS.Tombstone.Store(tombstone, func() error {
|
||||
return t.state.Caches.DB.Tombstone.Store(tombstone, func() error {
|
||||
_, err := t.db.
|
||||
NewInsert().
|
||||
Model(tombstone).
|
||||
|
|
@ -67,7 +67,7 @@ func (t *tombstoneDB) PutTombstone(ctx context.Context, tombstone *gtsmodel.Tomb
|
|||
}
|
||||
|
||||
func (t *tombstoneDB) DeleteTombstone(ctx context.Context, id string) error {
|
||||
defer t.state.Caches.GTS.Tombstone.Invalidate("ID", id)
|
||||
defer t.state.Caches.DB.Tombstone.Invalidate("ID", id)
|
||||
|
||||
// Delete tombstone from DB.
|
||||
_, err := t.db.NewDelete().
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue