[feature] add per-uri dereferencer locks (#2291)

This commit is contained in:
kim 2023-10-31 11:12:22 +00:00 committed by GitHub
commit ce71a5a790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 2432 additions and 2719 deletions

View file

@ -19,7 +19,6 @@ package federatingdb
import (
"context"
"errors"
"net/url"
)
@ -35,9 +34,5 @@ import (
//
// Used to ensure race conditions in multiple requests do not occur.
func (f *federatingDB) Lock(c context.Context, id *url.URL) (func(), error) {
if id == nil {
return nil, errors.New("Lock: id was nil")
}
unlock := f.locks.Lock(id.String())
return unlock, nil
return f.state.FedLocks.Lock("federatingDB " + id.String()), nil // id should NEVER be nil.
}