Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Feb 3, 2025
1 parent 58420f1 commit 24b8ceb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class HttpClientZioBackend private (
b: ZioStreams.BinaryStream,
callback: () => Unit
): ZioStreams.BinaryStream =
b.ensuring(ZIO.attempt(callback()).orDie)
b.ensuringWith(exit => if (exit.isSuccess) ZIO.attempt(callback()).orDie else ZIO.unit)
}

object HttpClientZioBackend {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ class HttpClientZioBackend private (
override protected def addOnEndCallbackToBody(
b: ZioStreams.BinaryStream,
callback: () => Unit
): ZioStreams.BinaryStream =
b.ensuring(ZIO.effect(callback()).orDie)
): ZioStreams.BinaryStream = b.++(ZStream.execute(ZIO.effect(callback())))
}

object HttpClientZioBackend {
Expand Down

0 comments on commit 24b8ceb

Please sign in to comment.