Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ListBucketContext in bucket.go #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update bucket.go
emmm...
  • Loading branch information
xtqxk authored Oct 10, 2021
commit 03e316e7e00933b9751a705c01fef200a39239f5
4 changes: 2 additions & 2 deletions storage/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ func (m *BucketManager) ListBucket(bucket, prefix, delimiter, marker string) (re
// 接受的context可以用来取消列举操作
func (m *BucketManager) ListBucketContext(ctx context.Context, bucket, prefix, delimiter, marker string) (retCh chan listFilesRet2, err error) {

ctx = auth.WithCredentialsType(context.Background(), m.Mac, auth.TokenQiniu)
ctxLocal := auth.WithCredentialsType(ctx, m.Mac, auth.TokenQiniu)
reqHost, reqErr := m.RsfReqHost(bucket)
if reqErr != nil {
err = reqErr
Expand All @@ -527,7 +527,7 @@ func (m *BucketManager) ListBucketContext(ctx context.Context, bucket, prefix, d

// limit 0 ==> 列举所有文件
reqURL := fmt.Sprintf("%s%s", reqHost, uriListFiles2(bucket, prefix, delimiter, marker))
retCh, err = callChan(m.Client, ctx, "POST", reqURL, nil)
retCh, err = callChan(m.Client, ctxLocal, "POST", reqURL, nil)
return
}

Expand Down