Don't log an error if context is cancelled.

This commit is contained in:
jholdstock 2020-06-10 12:17:39 +01:00 committed by David Hill
parent 72c16ad2c7
commit 82dc5f5ba1

View File

@ -214,7 +214,7 @@ func connectNotifier(dcrdWithNotifs rpc.DcrdConnect) error {
// notifier is closed.
select {
case <-ctx.Done():
return ctx.Err()
return nil
case <-notifierClosed:
return nil
}
@ -240,14 +240,14 @@ func Start(c context.Context, vdb *database.VspDatabase, drpc rpc.DcrdConnect,
err := connectNotifier(dcrdWithNotif)
if err != nil {
log.Errorf("dcrd connect error: %v", err)
}
// If context is done (vspd is shutting down), return,
// otherwise wait 15 seconds and try to reconnect.
select {
case <-ctx.Done():
return
case <-time.After(15 * time.Second):
}
// If context is done (vspd is shutting down), return,
// otherwise wait 15 seconds and try to reconnect.
select {
case <-ctx.Done():
return
case <-time.After(15 * time.Second):
}
}