mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:52:27 -05:00
[feature] add per-uri dereferencer locks (#2291)
This commit is contained in:
parent
51d0a0bba5
commit
ce71a5a790
54 changed files with 2432 additions and 2719 deletions
|
|
@ -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.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue