Skip to content

Commit d932ada

Browse files
committed
Fix bug introduced in previous commit.
1 parent f826d60 commit d932ada

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

utils/client.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ func NewAPIClient(agent string) (*APIClient, error) {
4646
// slice. The objects are put into the outCh as they are retrieved.
4747
func (c *APIClient) RetrieveObjects(endpoint string, args []string, outCh chan *vt.Object, errCh chan error) error {
4848

49-
// Make sure outCh is closed
49+
// Make sure outCh and errCh are closed
5050
defer close(outCh)
51+
defer close(errCh)
5152

5253
h := PQueue{}
5354
heap.Init(&h)
@@ -126,11 +127,11 @@ func (c *APIClient) RetrieveObjects(endpoint string, args []string, outCh chan *
126127
// Wait for all objects to be retrieved
127128
getWg.Wait()
128129

129-
// Once all object were retrieved is safe to close objCh and errCh
130+
// Once all object were retrieved is safe to close objCh.
130131
close(objCh)
131-
close(errCh)
132132

133133
// Wait for objects to be sent to outCh
134134
outWg.Wait()
135+
135136
return nil
136137
}

0 commit comments

Comments
 (0)