mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 00:46:15 -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
|
|
@ -22,12 +22,8 @@ import (
|
|||
"net/url"
|
||||
)
|
||||
|
||||
// Exists returns true if the database has an entry for the specified
|
||||
// id. It may not be owned by this application instance.
|
||||
//
|
||||
// The library makes this call only after acquiring a lock first.
|
||||
//
|
||||
// Implementation note: this just straight up isn't implemented, and doesn't *really* need to be either.
|
||||
// Exists is an implementation of pub.Database{}.Exists(), optimized specifically for
|
||||
// the only usecase in which go-fed/activity/pub actually calls it. Do not use otherwise!
|
||||
func (f *federatingDB) Exists(ctx context.Context, id *url.URL) (exists bool, err error) {
|
||||
return false, nil
|
||||
return f.createdIDs.Has(id.String()), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue