Skip to content

Commit

Permalink
Apply scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
wemrysi committed Nov 27, 2020
1 parent 269681c commit 9815784
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion core/js/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ trait IOApp {
else
args.toList

Spawn[IO].raceOutcome[ExitCode, Nothing](run(argList), keepAlive)
Spawn[IO]
.raceOutcome[ExitCode, Nothing](run(argList), keepAlive)
.flatMap {
case Left(Outcome.Canceled()) =>
IO.raiseError(new RuntimeException("IOApp main fiber canceled"))
Expand Down
22 changes: 11 additions & 11 deletions core/jvm/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ trait IOApp {
val ioa = run(args.toList)

val fiber =
ioa.onCancel(
IO {
ioa
.onCancel(IO {
error = new RuntimeException("IOApp main fiber canceled")
latch.countDown()
})
.unsafeRunFiber(
{ t =>
error = t
latch.countDown()
},
{ a =>
result = a
latch.countDown()
})(runtime)
.unsafeRunFiber(
{ t =>
error = t
latch.countDown()
},
{ a =>
result = a
latch.countDown()
})(runtime)

def handleShutdown(): Unit = {
if (latch.getCount() > 0) {
Expand Down

0 comments on commit 9815784

Please sign in to comment.