X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/46b11ba2ed71e2c074e9e6c8f5b9f7a003e7067f..50128b53da4003912635b03fb27b5be2c5beaca1:/services/keepstore/pull_worker.go?ds=sidebyside diff --git a/services/keepstore/pull_worker.go b/services/keepstore/pull_worker.go index 2626d4bf68..12860bb662 100644 --- a/services/keepstore/pull_worker.go +++ b/services/keepstore/pull_worker.go @@ -1,8 +1,8 @@ package main import ( + "context" "crypto/rand" - "errors" "fmt" "git.curoverse.com/arvados.git/sdk/go/keepclient" "io" @@ -57,7 +57,7 @@ func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc return } if reader == nil { - return errors.New(fmt.Sprintf("No reader found for : %s", signedLocator)) + return fmt.Errorf("No reader found for : %s", signedLocator) } defer reader.Close() @@ -67,7 +67,7 @@ func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc } if (readContent == nil) || (int64(len(readContent)) != contentLen) { - return errors.New(fmt.Sprintf("Content not found for: %s", signedLocator)) + return fmt.Errorf("Content not found for: %s", signedLocator) } err = PutContent(readContent, pullRequest.Locator) @@ -95,6 +95,6 @@ func GenerateRandomAPIToken() string { // Put block var PutContent = func(content []byte, locator string) (err error) { - _, err = PutBlock(content, locator) + _, err = PutBlock(context.Background(), content, locator) return }