mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 00:36:14 -06:00
keep a cache of activity IDs we have handled creates for
This commit is contained in:
parent
2f447702d2
commit
2aee3a2605
5 changed files with 15 additions and 9 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"context"
|
||||
"net/url"
|
||||
|
||||
"codeberg.org/gruf/go-cache/v3/simple"
|
||||
"github.com/superseriousbusiness/activity/pub"
|
||||
"github.com/superseriousbusiness/activity/streams/vocab"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
||||
|
|
@ -61,6 +62,10 @@ type federatingDB struct {
|
|||
visFilter *visibility.Filter
|
||||
intFilter *interaction.Filter
|
||||
spamFilter *spam.Filter
|
||||
|
||||
// tracks Activity IDs we have handled creates for,
|
||||
// for use in the Exists() function during forwarding.
|
||||
createdIDs simple.Cache[string, struct{}]
|
||||
}
|
||||
|
||||
// New returns a DB that satisfies the pub.Database
|
||||
|
|
@ -79,5 +84,6 @@ func New(
|
|||
intFilter: intFilter,
|
||||
spamFilter: spamFilter,
|
||||
}
|
||||
fdb.createdIDs.Init(0, 1000)
|
||||
return &fdb
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue