Watch context for completion also
This commit is contained in:
parent
53e06f358a
commit
02b0c8dd94
@ -399,15 +399,9 @@ func testRetrieval(t *testing.T, ctx context.Context, err error, client *impl.Fu
|
||||
IsCAR: carExport,
|
||||
}
|
||||
updates, err := client.ClientRetrieve(ctx, offers[0].Order(caddr), ref)
|
||||
for {
|
||||
select {
|
||||
case update, ok := <-updates:
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
if update.Err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
for update := range updates {
|
||||
if update.Err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -860,8 +860,10 @@ var clientRetrieveCmd = &cli.Command{
|
||||
}
|
||||
|
||||
if evt.Err != nil {
|
||||
return xerrors.Errorf("Retrieval Failed: %w", err)
|
||||
return xerrors.Errorf("retrieval failed: %w", err)
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return xerrors.Errorf("retrieval timed out")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user