diff options
Diffstat (limited to 'internal/typeutils')
-rw-r--r-- | internal/typeutils/converter.go | 9 | ||||
-rw-r--r-- | internal/typeutils/internaltoas.go | 13 |
2 files changed, 2 insertions, 20 deletions
diff --git a/internal/typeutils/converter.go b/internal/typeutils/converter.go index b2f12a592..155266968 100644 --- a/internal/typeutils/converter.go +++ b/internal/typeutils/converter.go @@ -25,7 +25,6 @@ import ( "github.com/superseriousbusiness/activity/streams/vocab" "github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/api/model" - "github.com/superseriousbusiness/gotosocial/internal/cache" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" ) @@ -194,14 +193,10 @@ type TypeConverter interface { } type converter struct { - db db.DB - asCache cache.Cache + db db.DB } // NewConverter returns a new Converter func NewConverter(db db.DB) TypeConverter { - return &converter{ - db: db, - asCache: cache.New(), - } + return &converter{db: db} } diff --git a/internal/typeutils/internaltoas.go b/internal/typeutils/internaltoas.go index 2e6bd3091..a14a3dbab 100644 --- a/internal/typeutils/internaltoas.go +++ b/internal/typeutils/internaltoas.go @@ -348,14 +348,6 @@ func (c *converter) AccountToASMinimal(ctx context.Context, a *gtsmodel.Account) } func (c *converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (vocab.ActivityStreamsNote, error) { - // first check if we have this note in our asCache already - if noteI, err := c.asCache.Fetch(s.ID); err == nil { - if note, ok := noteI.(vocab.ActivityStreamsNote); ok { - // we have it, so just return it as-is - return note, nil - } - } - // ensure prerequisites here before we get stuck in // check if author account is already attached to status and attach it if not @@ -550,11 +542,6 @@ func (c *converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (vocab.A sensitiveProp.AppendXMLSchemaBoolean(s.Sensitive) status.SetActivityStreamsSensitive(sensitiveProp) - // put the note in our cache in case we need it again soon - if err := c.asCache.Store(s.ID, status); err != nil { - return nil, err - } - return status, nil } |