mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-28 09:43:32 -06:00
[bugfix] fix possible infinite loops in media / emoji cleanup (#2590)
* update media / emoji cleaner funcs to use new paging package, check for same returned maxID * fix other calls of getattachments and getmojis not using paging * use alternative order-by function
This commit is contained in:
parent
0f7a2024c3
commit
c9452f32f3
8 changed files with 158 additions and 119 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/paging"
|
||||
)
|
||||
|
||||
// EmojiAllDomains can be used as the `domain` value in a GetEmojis
|
||||
|
|
@ -47,10 +48,10 @@ type Emoji interface {
|
|||
GetUseableEmojis(ctx context.Context) ([]*gtsmodel.Emoji, error)
|
||||
|
||||
// GetEmojis fetches all emojis with IDs less than 'maxID', up to a maximum of 'limit' emojis.
|
||||
GetEmojis(ctx context.Context, maxID string, limit int) ([]*gtsmodel.Emoji, error)
|
||||
GetEmojis(ctx context.Context, page *paging.Page) ([]*gtsmodel.Emoji, error)
|
||||
|
||||
// GetRemoteEmojis fetches all remote emojis with IDs less than 'maxID', up to a maximum of 'limit' emojis.
|
||||
GetRemoteEmojis(ctx context.Context, maxID string, limit int) ([]*gtsmodel.Emoji, error)
|
||||
GetRemoteEmojis(ctx context.Context, page *paging.Page) ([]*gtsmodel.Emoji, error)
|
||||
|
||||
// GetCachedEmojisOlderThan fetches all cached remote emojis with 'updated_at' greater than 'olderThan', up to a maximum of 'limit' emojis.
|
||||
GetCachedEmojisOlderThan(ctx context.Context, olderThan time.Time, limit int) ([]*gtsmodel.Emoji, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue