fix timeline preload state check

This commit is contained in:
kim 2025-04-08 16:52:53 +01:00
commit cc86a08f15
3 changed files with 9 additions and 68 deletions

View file

@ -90,35 +90,3 @@ func (p *Processor) HomeTimelineGet(
},
)
}
// preloadHomeTimeline will ensure that the timeline
// cache for home owned by given account is preloaded.
// func (p *Processor) preloadHomeTimeline(
// ctx context.Context,
// account *gtsmodel.Account,
// ) error {
// // Get (and so, create) home timeline cache for account ID.
// timeline := p.state.Caches.Timelines.Home.MustGet(account.ID)
// // Preload timeline with funcs.
// n, err := timeline.Preload(ctx,
// // Database load function.
// func(page *paging.Page) ([]*gtsmodel.Status, error) {
// return p.state.DB.GetHomeTimeline(ctx, account.ID, page)
// },
// // Status filtering function.
// func(status *gtsmodel.Status) (bool, error) {
// ok, err := p.visFilter.StatusHomeTimelineable(ctx, account, status)
// return !ok, err
// },
// )
// if err != nil {
// return gtserror.Newf("error preloading home timeline %s: %w", account.ID, err)
// }
// log.Infof(ctx, "%s: preloaded %d", account.Username, n)
// return nil
// }