mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 13:55:55 +00:00
command/lock: Ensure a conflict between lock and semaphore with shared prefix
This commit is contained in:
parent
06249f0ee6
commit
08c0a81e4f
@ -186,7 +186,10 @@ RELEASE:
|
||||
// setupLock is used to setup a new Lock given the API client,
|
||||
// the key prefix to operate on, and an optional session name.
|
||||
func (c *LockCommand) setupLock(client *api.Client, prefix, name string) (*LockUnlock, error) {
|
||||
key := path.Join(prefix, "lock")
|
||||
// Use the DefaultSemaphoreKey extention, this way if a lock and
|
||||
// semaphore are both used at the same prefix, we will get a conflict
|
||||
// which we can report to the user.
|
||||
key := path.Join(prefix, api.DefaultSemaphoreKey)
|
||||
if c.verbose {
|
||||
c.Ui.Info(fmt.Sprintf("Setting up lock at path: %s", key))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user