mirror of https://github.com/zlatinb/muwire
shutdown cleanly on exit
parent
e2f92c5c5e
commit
9008fac24d
|
@ -62,7 +62,11 @@ class Cli {
|
|||
def toShare = it.readLine()
|
||||
core.eventBus.publish(new FileSharedEvent(file : new File(toShare)))
|
||||
}
|
||||
|
||||
Runtime.getRuntime().addShutdownHook({
|
||||
println "shutting down.."
|
||||
core.shutdown()
|
||||
println "shutdown."
|
||||
})
|
||||
Thread.sleep(Integer.MAX_VALUE)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue