From f4fcffc8b56ef73c184ae17892b69181961c15c7 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:24:39 +0000 Subject: [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 --- internal/processing/status/fave.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/processing/status/fave.go') diff --git a/internal/processing/status/fave.go b/internal/processing/status/fave.go index dbeba7fe9..7ac270e8c 100644 --- a/internal/processing/status/fave.go +++ b/internal/processing/status/fave.go @@ -47,6 +47,7 @@ func (p *Processor) getFaveableStatus( ctx, requester, targetID, + false, // refresh ) if errWithCode != nil { return nil, nil, errWithCode @@ -149,7 +150,11 @@ func (p *Processor) FaveRemove(ctx context.Context, requestingAccount *gtsmodel. // FavedBy returns a slice of accounts that have liked the given status, filtered according to privacy settings. func (p *Processor) FavedBy(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) ([]*apimodel.Account, gtserror.WithCode) { - targetStatus, errWithCode := p.c.GetVisibleTargetStatus(ctx, requestingAccount, targetStatusID) + targetStatus, errWithCode := p.c.GetVisibleTargetStatus(ctx, + requestingAccount, + targetStatusID, + false, // refresh + ) if errWithCode != nil { return nil, errWithCode } -- cgit v1.2.3