Add UseIn() function for ConsulLocker

This commit is contained in:
Marius 2016-03-04 22:14:09 +01:00
parent 24e481c10c
commit 77b90ad317
1 changed files with 4 additions and 0 deletions

View File

@ -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.
func (locker *ConsulLocker) LockUpload(id string) error {
lock, err := locker.Client.LockOpts(&consul.LockOptions{