Skip to content

Commit

Permalink
Implemented handler for SIGTERM
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdeleon committed Jun 19, 2019
1 parent a31afbf commit b97c27d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/scala/taxfix/graknsupervisor/GraknSupervisor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ object GraknSupervisor extends App {
var killed = false

// Setup the callback for exit signal to shutdown Grakn gracefully
Signal.handle(new Signal("INT"), (_: Signal) => {
Signal.handle(new Signal("INT"), (_: Signal) => kill())
Signal.handle(new Signal("TERM"), (_: Signal) => kill())

def kill() = {
killed = true
log.log("supervisor", "message", s"Received kill signal! Stopping all Grakn processes")
handleSupervisorExit()
})
}


val storageExitFuture = Future {
Expand Down

0 comments on commit b97c27d

Please sign in to comment.