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/tag.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/tag.go')
-rw-r--r-- | internal/db/bundb/tag.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/db/bundb/tag.go b/internal/db/bundb/tag.go index db1effaf4..5218a19d5 100644 --- a/internal/db/bundb/tag.go +++ b/internal/db/bundb/tag.go @@ -33,7 +33,7 @@ type tagDB struct { } func (t *tagDB) GetTag(ctx context.Context, id string) (*gtsmodel.Tag, error) { - return t.state.Caches.GTS.Tag.LoadOne("ID", func() (*gtsmodel.Tag, error) { + return t.state.Caches.DB.Tag.LoadOne("ID", func() (*gtsmodel.Tag, error) { var tag gtsmodel.Tag q := t.db. @@ -54,7 +54,7 @@ func (t *tagDB) GetTagByName(ctx context.Context, name string) (*gtsmodel.Tag, e name = strings.TrimSpace(name) name = strings.ToLower(name) - return t.state.Caches.GTS.Tag.LoadOne("Name", func() (*gtsmodel.Tag, error) { + return t.state.Caches.DB.Tag.LoadOne("Name", func() (*gtsmodel.Tag, error) { var tag gtsmodel.Tag q := t.db. @@ -72,7 +72,7 @@ func (t *tagDB) GetTagByName(ctx context.Context, name string) (*gtsmodel.Tag, e func (t *tagDB) GetTags(ctx context.Context, ids []string) ([]*gtsmodel.Tag, error) { // Load all tag IDs via cache loader callbacks. - tags, err := t.state.Caches.GTS.Tag.LoadIDs("ID", + tags, err := t.state.Caches.DB.Tag.LoadIDs("ID", ids, func(uncached []string) ([]*gtsmodel.Tag, error) { // Preallocate expected length of uncached tags. @@ -115,7 +115,7 @@ func (t *tagDB) PutTag(ctx context.Context, tag *gtsmodel.Tag) error { t2.Name = strings.ToLower(t2.Name) // Insert the copy. - if err := t.state.Caches.GTS.Tag.Store(t2, func() error { + if err := t.state.Caches.DB.Tag.Store(t2, func() error { _, err := t.db.NewInsert().Model(t2).Exec(ctx) return err }); err != nil { |