fix: Get needs to actually return the entry
This commit is contained in:
parent
15d0999fdf
commit
c6aa2cf4a2
|
@ -240,11 +240,10 @@ func (r *RegistryServiceDefault) Get(pk []byte) (protocol.SignedRegistryEntry, e
|
|||
return res, nil
|
||||
}
|
||||
|
||||
if res == nil {
|
||||
r.Logger().Debug("[registry] get (cached)", zap.String("key", keyString))
|
||||
for i := 0; i < 200; i++ {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
res, err := r.getFromDB(pk)
|
||||
res, err = r.getFromDB(pk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -252,9 +251,8 @@ func (r *RegistryServiceDefault) Get(pk []byte) (protocol.SignedRegistryEntry, e
|
|||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (r *RegistryServiceDefault) Listen(pk []byte, cb func(sre protocol.SignedRegistryEntry)) (func(), error) {
|
||||
|
|
Loading…
Reference in New Issue