fix: null pointer when unable to startu peerfinder
All checks were successful
Go Bump / bump (push) Successful in 30s
Go Test / test (push) Successful in 43s
Deploy / deploy (push) Successful in 1m25s

This commit is contained in:
xuu 2023-10-02 11:26:14 -06:00
parent a5780449fc
commit 41476d04a2

View File

@ -91,17 +91,17 @@ func (s *service) Run(ctx context.Context) (err error) {
subRes, e := s.es.EventStream().Subscribe(ctx, queueResults, 0)
errs = multierr.Append(errs, e)
if errs != nil {
return errs
}
defer func() {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
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 {
var events event.Events
select {