src/main/java/ch/uzh/ifi/seal/ase/cscc/RecommenderHelper.java
private static void addShutdownHook() {
        final Thread mainThread = Thread.currentThread();
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            System.out.println(" === SHUTTING DOWN GRACEFULLY ===");
            CSCCConfiguration.keepRunning = false;
            try {
                mainThread.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }));
    }
/**
     * Shuts down DiskBasedInvertedIndex gracefully so that indexing can continue when it is started again.
     */
Shuts down DiskBasedInvertedIndex gracefully so that indexing can continue when it is started again.
Shuts down DiskBasedInvertedIndex gracefully so that indexing can continue when it is started again .
private static void addShutdownHook() {
        final Thread mainThread = Thread.currentThread();
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            System.out.println(" === SHUTTING DOWN GRACEFULLY ===");
            CSCCConfiguration.keepRunning = false;
            try {
                mainThread.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }));
    }
private static void addShutdownHook ( ) { final Thread mainThread = Thread . currentThread ( ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> { System . out . println ( " === SHUTTING DOWN GRACEFULLY ===" ) ; CSCCConfiguration . keepRunning = false ; try { mainThread . join ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } ) ) ; }
Shuts down DiskBasedInvertedIndex gracefully so that indexing can continue when it is started again.
Shuts down DiskBasedInvertedIndex gracefully so that indexing can continue when it is started again .