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