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/report.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/report.go')
-rw-r--r-- | internal/db/bundb/report.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/db/bundb/report.go b/internal/db/bundb/report.go index f99f0b5cc..d2096a78a 100644 --- a/internal/db/bundb/report.go +++ b/internal/db/bundb/report.go @@ -147,7 +147,7 @@ func (r *reportDB) GetReports(ctx context.Context, resolved *bool, accountID str func (r *reportDB) getReport(ctx context.Context, lookup string, dbQuery func(*gtsmodel.Report) error, keyParts ...any) (*gtsmodel.Report, error) { // Fetch report from database cache with loader callback - report, err := r.state.Caches.GTS.Report.LoadOne(lookup, func() (*gtsmodel.Report, error) { + report, err := r.state.Caches.DB.Report.LoadOne(lookup, func() (*gtsmodel.Report, error) { var report gtsmodel.Report // Not cached! Perform database query @@ -242,7 +242,7 @@ func (r *reportDB) PopulateReport(ctx context.Context, report *gtsmodel.Report) } func (r *reportDB) PutReport(ctx context.Context, report *gtsmodel.Report) error { - return r.state.Caches.GTS.Report.Store(report, func() error { + return r.state.Caches.DB.Report.Store(report, func() error { _, err := r.db.NewInsert().Model(report).Exec(ctx) return err }) @@ -264,12 +264,12 @@ func (r *reportDB) UpdateReport(ctx context.Context, report *gtsmodel.Report, co return nil, err } - r.state.Caches.GTS.Report.Invalidate("ID", report.ID) + r.state.Caches.DB.Report.Invalidate("ID", report.ID) return report, nil } func (r *reportDB) DeleteReportByID(ctx context.Context, id string) error { - defer r.state.Caches.GTS.Report.Invalidate("ID", id) + defer r.state.Caches.DB.Report.Invalidate("ID", id) // Load status into cache before attempting a delete, // as we need it cached in order to trigger the invalidate |