Skip to content

Commit

Permalink
feat: add exit logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hataehyeok committed Dec 10, 2023
1 parent d0b77c7 commit 7c946e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions master/src/main/scala/Master.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object Master extends Logging {
master.run()(ExecutionContext.global),
scala.concurrent.duration.Duration.Inf
)
System.exit(0)
}

}
Expand Down
13 changes: 9 additions & 4 deletions worker/src/main/scala/Worker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ object Worker extends Logging {
workerArguments.outputDirectory
)

Await.result(
worker.run()(ExecutionContext.global),
scala.concurrent.duration.Duration.Inf
)
try {
Await.result(
worker.run()(ExecutionContext.global),
scala.concurrent.duration.Duration.Inf
)
} catch {
case _: io.grpc.StatusRuntimeException => System.exit(0)
case _: Exception => System.exit(1)
}
}

}
Expand Down

0 comments on commit 7c946e3

Please sign in to comment.