private void deleteAsync ( final File file ) { new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { try { logger . info ( "Waiting for " + deleteBackupMs + " milliseconds before deleting " + file . getAbsolutePath ( ) ) ; Thread . sleep ( deleteBackupMs ) ; } catch ( InterruptedException e ) { logger . warn ( "Did not sleep enough before deleting backups" ) ; } logger . info ( "Deleting file " + file . getAbsolutePath ( ) ) ; Utils . rm ( file ) ; logger . info ( "Deleting of " + file . getAbsolutePath ( ) + " completed successfully." ) ; storeVersionManager . syncInternalStateFromFileSystem ( true ) ; } catch ( Exception e ) { logger . error ( "Exception during deleteAsync for path: " + file , e ) ; } } } , "background-file-delete" ) . start ( ) ; }
Delete the given file in a separate thread