diff options
author | 2023-12-15 14:24:39 +0000 | |
---|---|---|
committer | 2023-12-15 15:24:39 +0100 | |
commit | f4fcffc8b56ef73c184ae17892b69181961c15c7 (patch) | |
tree | b678c44c9106e2ec8069dcf596a0554dee7410ab /internal/db/bundb/poll_test.go | |
parent | [bugfix] Let templates deref pointers, as a treat (#2448) (diff) | |
download | gotosocial-f4fcffc8b56ef73c184ae17892b69181961c15c7.tar.xz |
[bugfix] use a much shorter refresh limit for statuses with polls (#2453)v0.13.0
* 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>
Diffstat (limited to 'internal/db/bundb/poll_test.go')
-rw-r--r-- | internal/db/bundb/poll_test.go | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/internal/db/bundb/poll_test.go b/internal/db/bundb/poll_test.go index 479557c55..6bdbdb983 100644 --- a/internal/db/bundb/poll_test.go +++ b/internal/db/bundb/poll_test.go @@ -67,10 +67,6 @@ func (suite *PollTestSuite) TestGetPollBy() { "id": func() (*gtsmodel.Poll, error) { return suite.db.GetPollByID(ctx, poll.ID) }, - - "status_id": func() (*gtsmodel.Poll, error) { - return suite.db.GetPollByStatusID(ctx, poll.StatusID) - }, } { // Clear database caches. @@ -287,10 +283,6 @@ func (suite *PollTestSuite) TestDeletePoll() { // Ensure that afterwards we cannot fetch poll. _, err = suite.db.GetPollByID(ctx, poll.ID) suite.ErrorIs(err, db.ErrNoEntries) - - // Or again by the status it's attached to. - _, err = suite.db.GetPollByStatusID(ctx, poll.StatusID) - suite.ErrorIs(err, db.ErrNoEntries) } } |