Commit a462b6e9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b61e1bf5
...@@ -44,8 +44,7 @@ type AuthCacheEntry struct { ...@@ -44,8 +44,7 @@ type AuthCacheEntry struct {
AuthReply AuthReply
Tauth int64 // in seconds XXX needed? Tauth int64 // in seconds XXX needed?
Nhit int64 // how many times this entry was hit when querying Nhit int64 // how many times this entry was hit when querying auth cache during the last refresh period.
// auth cache during the last refresh period.
ready chan struct{} // closed when entry is ready ready chan struct{} // closed when entry is ready
} }
...@@ -86,9 +85,10 @@ have_entry: ...@@ -86,9 +85,10 @@ have_entry:
authReply = auth.AuthReply authReply = auth.AuthReply
auth.Unlock() auth.Unlock()
// no entry - relock the cache in exclusive mode, create empty entry,
// and start filling it
} else { } else {
// no entry - relock the cache in exclusive mode, create empty entry,
// and start filling it
c.mu.Lock() c.mu.Lock()
// another ex-reader could be trying to create this entry // another ex-reader could be trying to create this entry
// simultaneously with us - recheck // simultaneously with us - recheck
...@@ -120,7 +120,6 @@ have_entry: ...@@ -120,7 +120,6 @@ have_entry:
return authReply return authReply
} }
// Time period for refreshing / removing unused entires in authCache // Time period for refreshing / removing unused entires in authCache
const authCacheRefresh = 30 * time.Second const authCacheRefresh = 30 * time.Second
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment