Handle Attestations in a Separate Goroutine (#3487)

* move into separate routine

* preston's review

* use opencensus
This commit is contained in:
Nishant Das 2019-09-17 21:47:21 +05:30 committed by Raul Jordan
parent b63e938cfb
commit b1b76ac87c

View File

@ -37,11 +37,12 @@ func (as *AttesterServer) SubmitAttestation(ctx context.Context, att *ethpb.Atte
return nil, errors.Wrap(err, "failed to sign root attestation") return nil, errors.Wrap(err, "failed to sign root attestation")
} }
if err := as.operationsHandler.HandleAttestation(ctx, att); err != nil {
return nil, err
}
go func() { go func() {
ctx = trace.NewContext(context.Background(), trace.FromContext(ctx))
if err := as.operationsHandler.HandleAttestation(ctx, att); err != nil {
log.WithError(err).Error("could not handle attestation in operations service")
return
}
if err := as.attReceiver.ReceiveAttestation(ctx, att); err != nil { if err := as.attReceiver.ReceiveAttestation(ctx, att); err != nil {
log.WithError(err).Error("could not receive attestation in chain service") log.WithError(err).Error("could not receive attestation in chain service")
} }