Skip to content

Commit

Permalink
remove read mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
phbnf committed Aug 23, 2024
1 parent 2f15810 commit ed05a62
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions personalities/sctfe/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (cts *CTStorage) AddIssuerChain(ctx context.Context, chain []*x509.Certific
// Only up to N keys will be stored locally.
// TODO(phboneff): add monitoring for the number of keys
type cachedIssuerStorage struct {
sync.RWMutex
sync.Mutex
m map[string]struct{}
N int // maximum number of entries allowed in m
s IssuerStorage
Expand All @@ -104,9 +104,7 @@ type cachedIssuerStorage struct {
// Exists checks if the key exists in the local cache, if not checks in the underlying storage.
// If it finds it there, caches the key locally.
func (c *cachedIssuerStorage) Exists(ctx context.Context, key []byte) (bool, error) {
c.RLock()
_, ok := c.m[string(key)]
c.RUnlock()
if ok {
klog.V(2).Infof("Exists: found %q in local key cache", key)
return true, nil
Expand Down

0 comments on commit ed05a62

Please sign in to comment.