File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
api/v1/registry/client/cache Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ func (t *token) Exists(key string) bool {
29
29
_ , defined := t .items [key ]
30
30
31
31
if ! defined && WaitBetween != 0 {
32
- log .Debugf ("Locking token operations for %v (key: %s)" , WaitBetween , key )
32
+ log .Debugf ("[EXISTS] Locking token operations for %v (key: %s)" , WaitBetween , key )
33
33
time .Sleep (WaitBetween )
34
34
}
35
35
@@ -38,6 +38,14 @@ func (t *token) Exists(key string) bool {
38
38
39
39
// Get gets token for a passed key
40
40
func (t * token ) Get (key string ) auth.Token {
41
+ t .mux .Lock ()
42
+ defer t .mux .Unlock ()
43
+
44
+ if WaitBetween != 0 {
45
+ log .Debugf ("[GET] Locking token operations for %v (key: %s)" , WaitBetween , key )
46
+ time .Sleep (WaitBetween )
47
+ }
48
+
41
49
return t .items [key ]
42
50
}
43
51
You can’t perform that action at this time.
0 commit comments