Fix picking wrong token lock
This commit is contained in:
parent
185bcb7b48
commit
09720bbd8e
|
@ -4,7 +4,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -92,8 +91,7 @@ func NewTokenStore(c *Core, config *logical.BackendConfig) (*TokenStore, error)
|
||||||
|
|
||||||
t.tokenLocks = map[string]*sync.RWMutex{}
|
t.tokenLocks = map[string]*sync.RWMutex{}
|
||||||
for i := int64(0); i < 256; i++ {
|
for i := int64(0); i < 256; i++ {
|
||||||
t.tokenLocks[fmt.Sprintf("%2x",
|
t.tokenLocks[fmt.Sprintf("%02x", i)] = &sync.RWMutex{}
|
||||||
strconv.FormatInt(i, 16))] = &sync.RWMutex{}
|
|
||||||
}
|
}
|
||||||
t.tokenLocks["custom"] = &sync.RWMutex{}
|
t.tokenLocks["custom"] = &sync.RWMutex{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue