Add UseIn() function for ConsulLocker
This commit is contained in:
parent
24e481c10c
commit
77b90ad317
|
@ -45,6 +45,10 @@ func New(client *consul.Client) *ConsulLocker {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (locker *ConsulLocker) UseIn(composer *tusd.StoreComposer) {
|
||||||
|
composer.UseLocker(locker)
|
||||||
|
}
|
||||||
|
|
||||||
// LockUpload tries to obtain the exclusive lock.
|
// LockUpload tries to obtain the exclusive lock.
|
||||||
func (locker *ConsulLocker) LockUpload(id string) error {
|
func (locker *ConsulLocker) LockUpload(id string) error {
|
||||||
lock, err := locker.Client.LockOpts(&consul.LockOptions{
|
lock, err := locker.Client.LockOpts(&consul.LockOptions{
|
||||||
|
|
Loading…
Reference in New Issue