Skip to content

Commit

Permalink
Optimize singleton key conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
devfans committed Mar 2, 2022
1 parent 4e7787c commit 169039b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type SingletonStore struct {
func (s *SingletonStore) Single(o Singleton) (interface{}, error) {
s.Lock()
defer s.Unlock()
key := o.Key()
key := reflect.TypeOf(o).String() + ":" + o.Key()
ins, ok := s.state[key]
if ok {
return ins, nil
Expand Down

0 comments on commit 169039b

Please sign in to comment.