mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 03:02:25 -05:00
remove trim-after-insert behaviour
This commit is contained in:
parent
2509cb83b7
commit
379105e837
1 changed files with 4 additions and 9 deletions
13
internal/cache/timeline/status.go
vendored
13
internal/cache/timeline/status.go
vendored
|
|
@ -561,7 +561,7 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S
|
||||||
}
|
}
|
||||||
|
|
||||||
if status.BoostOfID != "" {
|
if status.BoostOfID != "" {
|
||||||
// Check through top $repeatBoostDepth number of timeline items.
|
// Check through top $repeatBoostDepth number of items.
|
||||||
for i, value := range t.cache.RangeUnsafe(structr.Desc) {
|
for i, value := range t.cache.RangeUnsafe(structr.Desc) {
|
||||||
if i >= repeatBoostDepth {
|
if i >= repeatBoostDepth {
|
||||||
break
|
break
|
||||||
|
|
@ -576,8 +576,8 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert new status into timeline.
|
// Insert new timeline status.
|
||||||
if t.cache.Insert(&StatusMeta{
|
t.cache.Insert(&StatusMeta{
|
||||||
ID: status.ID,
|
ID: status.ID,
|
||||||
AccountID: status.AccountID,
|
AccountID: status.AccountID,
|
||||||
BoostOfID: status.BoostOfID,
|
BoostOfID: status.BoostOfID,
|
||||||
|
|
@ -585,12 +585,7 @@ func (t *StatusTimeline) InsertOne(status *gtsmodel.Status, prepared *apimodel.S
|
||||||
repeatBoost: skip,
|
repeatBoost: skip,
|
||||||
loaded: nil,
|
loaded: nil,
|
||||||
prepared: prepared,
|
prepared: prepared,
|
||||||
}) > t.max {
|
})
|
||||||
|
|
||||||
// If cache reached beyond
|
|
||||||
// maximum, perform a trim.
|
|
||||||
t.Trim()
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue