Merge pull request #567 from ipfs/fix/godoc-wait-for

Docs: Fix comment for WaitFor function
This commit is contained in:
Hector Sanjuan 2018-10-03 11:39:23 +02:00 committed by GitHub
commit 5128d15a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,9 +204,14 @@ func (c *defaultClient) GetConnectGraph() (api.ConnectGraphSerial, error) {
return graphS, err return graphS, err
} }
// WaitFor is a utility function that allows for a caller to // WaitFor is a utility function that allows for a caller to wait for a
// wait for a paticular status for a CID. It returns a channel // paticular status for a CID (as defined by StatusFilterParams).
// upon which the caller can wait for the targetStatus. // It returns the final status for that CID and an error, if there was.
//
// WaitFor works by calling Status() repeatedly and checking that all
// peers have transitioned to the target TrackerStatus or are Remote.
// If an error of some type happens, WaitFor returns immediately with an
// empty GlobalPinInfo.
func WaitFor(ctx context.Context, c Client, fp StatusFilterParams) (api.GlobalPinInfo, error) { func WaitFor(ctx context.Context, c Client, fp StatusFilterParams) (api.GlobalPinInfo, error) {
ctx, cancel := context.WithCancel(ctx) ctx, cancel := context.WithCancel(ctx)
defer cancel() defer cancel()