fix: null pointer when unable to startu peerfinder
This commit is contained in:
parent
a5780449fc
commit
41476d04a2
|
@ -91,17 +91,17 @@ func (s *service) Run(ctx context.Context) (err error) {
|
||||||
subRes, e := s.es.EventStream().Subscribe(ctx, queueResults, 0)
|
subRes, e := s.es.EventStream().Subscribe(ctx, queueResults, 0)
|
||||||
errs = multierr.Append(errs, e)
|
errs = multierr.Append(errs, e)
|
||||||
|
|
||||||
|
if errs != nil {
|
||||||
|
return errs
|
||||||
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
err = multierr.Combine(errs, subReq.Close(ctx), subRes.Close(ctx))
|
err = multierr.Combine(err, subReq.Close(ctx), subRes.Close(ctx))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if errs != nil {
|
|
||||||
return errs
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
var events event.Events
|
var events event.Events
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user