mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-11 18:47:29 -06:00
[bugfix] fix case of failed timeline preload causing lockups (#4182)
- moves preloader Done() function calling to be handled entirely by the preloader, not the caller - adds tests for multiple preload success / failure / clear states Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4182 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
3cff4b2d7d
commit
3a29a59e55
3 changed files with 129 additions and 37 deletions
9
internal/cache/timeline/status.go
vendored
9
internal/cache/timeline/status.go
vendored
|
|
@ -196,14 +196,9 @@ func (t *StatusTimeline) Preload(
|
|||
n int,
|
||||
err error,
|
||||
) {
|
||||
t.preloader.CheckPreload(func(ptr *any) {
|
||||
err = t.preloader.CheckPreload(func() error {
|
||||
n, err = t.preload(loadPage, filter)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Mark as preloaded.
|
||||
t.preloader.Done(ptr)
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue