summaryrefslogtreecommitdiff
path: root/internal/db/bundb/instance.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-07-24 09:41:43 +0100
committerLibravatar GitHub <noreply@github.com>2024-07-24 10:41:43 +0200
commit63fc9b6c3e8a03010b662a4acad0eb6f04a11f04 (patch)
treef4bf28f78333365cbe9eeda19de4de566e475584 /internal/db/bundb/instance.go
parent[feature] Allow user to set "bot" flag; show bot icon on profile (#3135) (diff)
downloadgotosocial-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/instance.go')
-rw-r--r--internal/db/bundb/instance.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/instance.go b/internal/db/bundb/instance.go
index 73bbcea8b..6d98c8db7 100644
--- a/internal/db/bundb/instance.go
+++ b/internal/db/bundb/instance.go
@@ -143,7 +143,7 @@ func (i *instanceDB) GetInstanceByID(ctx context.Context, id string) (*gtsmodel.
func (i *instanceDB) getInstance(ctx context.Context, lookup string, dbQuery func(*gtsmodel.Instance) error, keyParts ...any) (*gtsmodel.Instance, error) {
// Fetch instance from database cache with loader callback
- instance, err := i.state.Caches.GTS.Instance.LoadOne(lookup, func() (*gtsmodel.Instance, error) {
+ instance, err := i.state.Caches.DB.Instance.LoadOne(lookup, func() (*gtsmodel.Instance, error) {
var instance gtsmodel.Instance
// Not cached! Perform database query.
@@ -219,7 +219,7 @@ func (i *instanceDB) PutInstance(ctx context.Context, instance *gtsmodel.Instanc
return gtserror.Newf("error punifying domain %s: %w", instance.Domain, err)
}
- return i.state.Caches.GTS.Instance.Store(instance, func() error {
+ return i.state.Caches.DB.Instance.Store(instance, func() error {
_, err := i.db.NewInsert().Model(instance).Exec(ctx)
return err
})
@@ -239,7 +239,7 @@ func (i *instanceDB) UpdateInstance(ctx context.Context, instance *gtsmodel.Inst
columns = append(columns, "updated_at")
}
- return i.state.Caches.GTS.Instance.Store(instance, func() error {
+ return i.state.Caches.DB.Instance.Store(instance, func() error {
_, err := i.db.
NewUpdate().
Model(instance).