Commit a462b6e9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b61e1bf5
......@@ -44,8 +44,7 @@ type AuthCacheEntry struct {
AuthReply
Tauth int64 // in seconds XXX needed?
Nhit int64 // how many times this entry was hit when querying
// auth cache during the last refresh period.
Nhit int64 // how many times this entry was hit when querying auth cache during the last refresh period.
ready chan struct{} // closed when entry is ready
}
......@@ -86,9 +85,10 @@ have_entry:
authReply = auth.AuthReply
auth.Unlock()
} else {
// no entry - relock the cache in exclusive mode, create empty entry,
// and start filling it
} else {
c.mu.Lock()
// another ex-reader could be trying to create this entry
// simultaneously with us - recheck
......@@ -120,7 +120,6 @@ have_entry:
return authReply
}
// Time period for refreshing / removing unused entires in authCache
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