Skip to content

Commit

Permalink
Fix s3 upload stuck (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke authored Aug 24, 2024
1 parent 8c492ef commit 22e6d9a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/proc/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ func ProcessPutExtended(
var w io.WriteCloser
r, w := io.Pipe()

err := s.PutFileToDest(name, r, settings)

if err != nil {
_ = ycl.ReplyError(err, "failed to upload")

return err
}

defer r.Close()
defer w.Close()

Expand Down Expand Up @@ -103,6 +95,15 @@ func ProcessPutExtended(
}
}()

/* Should go after reader dispatch! */
err := s.PutFileToDest(name, r, settings)

if err != nil {
_ = ycl.ReplyError(err, "failed to upload")

return err
}

wg.Wait()

_, err = ycl.GetRW().Write(message.NewReadyForQueryMessage().Encode())
Expand Down

0 comments on commit 22e6d9a

Please sign in to comment.