Skip to content

Commit

Permalink
fix: use direct upload (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
istae authored Oct 26, 2023
1 parent 966d6dd commit 7d384c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/bee/api/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func (f *FilesService) Upload(ctx context.Context, name string, data io.Reader,
if o.Tag != 0 {
header.Set(swarmTagHeader, strconv.FormatUint(o.Tag, 10))
}
if o.Direct {
header.Set(deferredUploadHeader, strconv.FormatBool(false))
}
header.Set(postageStampBatchHeader, o.BatchID)

err = f.client.requestWithHeader(ctx, http.MethodPost, "/"+apiVersion+"/bzz?"+url.QueryEscape("name="+name), header, data, &resp)
Expand Down
4 changes: 2 additions & 2 deletions pkg/check/settlements/settlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewDefaultOptions() Options {
FileSize: 1 * 1024 * 1024, // 1mb
GasPrice: "",
PostageAmount: 1,
PostageDepth: 16,
PostageDepth: 20,
PostageLabel: "test-label",
Seed: 0,
Threshold: 10000000000000,
Expand Down Expand Up @@ -126,7 +126,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int
}
c.logger.Infof("node %s: batch id %s", uNode, batchID)

if err := client.UploadFile(ctx, &file, api.UploadOptions{BatchID: batchID}); err != nil {
if err := client.UploadFile(ctx, &file, api.UploadOptions{BatchID: batchID, Direct: true}); err != nil {
return fmt.Errorf("node %s: %w", uNode, err)
}
c.logger.Infof("File %s uploaded successfully to node %s", file.Address().String(), overlays[uNode].String())
Expand Down

0 comments on commit 7d384c3

Please sign in to comment.