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
|
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
|
||||||
}
|
}
|
||||||
|
@ -252,9 +251,8 @@ func (r *RegistryServiceDefault) Get(pk []byte) (protocol.SignedRegistryEntry, e
|
||||||
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