summaryrefslogtreecommitdiff
path: root/internal/timeline/timeline.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-06-11 11:18:44 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-11 10:18:44 +0100
commit5e2897e35cd2bea889fa37a2a857f4dcc076dafc (patch)
treeb1ac6203ffa20f5fff1c460fed942854a6e5c6bd /internal/timeline/timeline.go
parent[docs] Revamp the installation guide (#1877) (diff)
downloadgotosocial-5e2897e35cd2bea889fa37a2a857f4dcc076dafc.tar.xz
[bugfix] Invalidate timeline entries for status when stats change (#1879)
Diffstat (limited to 'internal/timeline/timeline.go')
-rw-r--r--internal/timeline/timeline.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/timeline/timeline.go b/internal/timeline/timeline.go
index b973a3905..e7c609638 100644
--- a/internal/timeline/timeline.go
+++ b/internal/timeline/timeline.go
@@ -78,12 +78,22 @@ type Timeline interface {
INDEXING + PREPARATION FUNCTIONS
*/
- // IndexAndPrepareOne puts a item into the timeline at the appropriate place according to its id, and then immediately prepares it.
+ // IndexAndPrepareOne puts a item into the timeline at the appropriate place
+ // according to its id, and then immediately prepares it.
//
- // The returned bool indicates whether or not the item was actually inserted into the timeline. This will be false
- // if the item is a boost and the original item or another boost of it already exists < boostReinsertionDepth back in the timeline.
+ // The returned bool indicates whether or not the item was actually inserted
+ // into the timeline. This will be false if the item is a boost and the original
+ // item, or a boost of it, already exists recently in the timeline.
IndexAndPrepareOne(ctx context.Context, itemID string, boostOfID string, accountID string, boostOfAccountID string) (bool, error)
+ // Unprepare clears the prepared version of the given item (and any boosts
+ // thereof) from the timeline, but leaves the indexed version in place.
+ //
+ // This is useful for cache invalidation when the prepared version of the
+ // item has changed for some reason (edits, updates, etc), but the item does
+ // not need to be removed: it will be prepared again next time Get is called.
+ Unprepare(ctx context.Context, itemID string) error
+
/*
INFO FUNCTIONS
*/