mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 05:52:25 -05:00
remove unnecessary change
This commit is contained in:
parent
227d6edc3e
commit
0955d1b86a
2 changed files with 23 additions and 43 deletions
24
internal/cache/db.go
vendored
24
internal/cache/db.go
vendored
|
|
@ -1312,6 +1312,28 @@ func (c *Caches) initStatus() {
|
|||
|
||||
log.Infof(nil, "cache size = %d", cap)
|
||||
|
||||
copyF := func(s1 *gtsmodel.Status) *gtsmodel.Status {
|
||||
s2 := new(gtsmodel.Status)
|
||||
*s2 = *s1
|
||||
|
||||
// Don't include ptr fields that
|
||||
// will be populated separately.
|
||||
// See internal/db/bundb/status.go.
|
||||
s2.Account = nil
|
||||
s2.InReplyTo = nil
|
||||
s2.InReplyToAccount = nil
|
||||
s2.BoostOf = nil
|
||||
s2.BoostOfAccount = nil
|
||||
s2.Poll = nil
|
||||
s2.Attachments = nil
|
||||
s2.Tags = nil
|
||||
s2.Mentions = nil
|
||||
s2.Emojis = nil
|
||||
s2.CreatedWithApplication = nil
|
||||
|
||||
return s2
|
||||
}
|
||||
|
||||
c.DB.Status.Init(structr.CacheConfig[*gtsmodel.Status]{
|
||||
Indices: []structr.IndexConfig{
|
||||
{Fields: "ID"},
|
||||
|
|
@ -1323,7 +1345,7 @@ func (c *Caches) initStatus() {
|
|||
},
|
||||
MaxSize: cap,
|
||||
IgnoreErr: ignoreErrors,
|
||||
Copy: copyStatus,
|
||||
Copy: copyF,
|
||||
Invalidate: c.OnInvalidateStatus,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue