mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 16:33:04 -06:00
[bugfix] use a much shorter refresh limit for statuses with polls (#2453)
* specifically use a much shorter refresh limit for statuses with polls * allow specifying whether status must be upToDate in calls to Get(Visible)?TargetStatusBy_(), limit force refresh to 5 minute cooldown * remove the PollID check from statusUpToDate() * remove unnecessary force flag checks * remove unused field * check refresh status error * use argument name 'refresh' instead of 'upToDate' to better fit with the codebase * add statuses_poll_id_idx * remove the definitely-not copy-pasted comment i accidentally typed out in full * only synchronously refresh if the refresh flag is provided, otherwise do async * fix wrong force value being provided for async --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
d0bb8f0973
commit
f4fcffc8b5
17 changed files with 207 additions and 98 deletions
|
|
@ -25,15 +25,18 @@ import (
|
|||
|
||||
// Status contains functions for getting statuses, creating statuses, and checking various other fields on statuses.
|
||||
type Status interface {
|
||||
// GetStatusByID returns one status from the database, with no rel fields populated, only their linking ID / URIs
|
||||
// GetStatusByID fetches the status from the database with matching id column.
|
||||
GetStatusByID(ctx context.Context, id string) (*gtsmodel.Status, error)
|
||||
|
||||
// GetStatusByURI returns one status from the database, with no rel fields populated, only their linking ID / URIs
|
||||
// GetStatusByURI fetches the status from the database with matching uri column.
|
||||
GetStatusByURI(ctx context.Context, uri string) (*gtsmodel.Status, error)
|
||||
|
||||
// GetStatusByURL returns one status from the database, with no rel fields populated, only their linking ID / URIs
|
||||
// GetStatusByURL fetches the status from the database with matching url column.
|
||||
GetStatusByURL(ctx context.Context, uri string) (*gtsmodel.Status, error)
|
||||
|
||||
// GetStatusByPollID fetches the status from the database with matching poll_id column.
|
||||
GetStatusByPollID(ctx context.Context, pollID string) (*gtsmodel.Status, error)
|
||||
|
||||
// GetStatusBoost fetches the status whose boost_of_id column refers to boostOfID, authored by given account ID.
|
||||
GetStatusBoost(ctx context.Context, boostOfID string, byAccountID string) (*gtsmodel.Status, error)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue