summaryrefslogtreecommitdiff
path: root/internal/timeline/timeline.go
diff options
context:
space:
mode:
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
*/