Skip to content

Commit

Permalink
fix(functions): create new reader for retrying deploy (#2840)
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge authored Nov 6, 2024
1 parent 9320b54 commit 5bd2b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/function/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig con
VerifyJwt: function.VerifyJWT,
ImportMapPath: toFileURL(function.ImportMap),
EntrypointPath: toFileURL(function.Entrypoint),
}, eszipContentType, &body); err != nil {
}, eszipContentType, bytes.NewReader(body.Bytes())); err != nil {
return errors.Errorf("failed to update function: %w", err)
} else if resp.JSON200 == nil {
return errors.Errorf("unexpected status %d: %s", resp.StatusCode(), string(resp.Body))
Expand All @@ -67,7 +67,7 @@ func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig con
VerifyJwt: function.VerifyJWT,
ImportMapPath: toFileURL(function.ImportMap),
EntrypointPath: toFileURL(function.Entrypoint),
}, eszipContentType, &body); err != nil {
}, eszipContentType, bytes.NewReader(body.Bytes())); err != nil {
return errors.Errorf("failed to create function: %w", err)
} else if resp.JSON201 == nil {
return errors.Errorf("unexpected status %d: %s", resp.StatusCode(), string(resp.Body))
Expand Down

0 comments on commit 5bd2b61

Please sign in to comment.