This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ESRunner runner = new ESRunner(); | |
// Gracefully shutdown | |
final Thread mainThread = Thread.currentThread(); | |
Runtime.getRuntime().addShutdownHook(new Thread(() -> { | |
try { | |
runner.shutdown(); // Clean up work | |
mainThread.join(200); // wait main thread to stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### get current directory in absolute path | |
# Add `> /dev/null 2>&1` to eliminate outputs of `cd` in some cases | |
base_dir="$( cd "$(dirname $0)" > /dev/null 2>&1 && pwd)" | |
# other options | |
current_dir=$(pwd) # current working directory | |
base_dir=$(dirname $0) # in relative path |
NewerOlder