comparison src/luan/modules/lucene/LuceneIndex.java @ 1406:8187ddb0e827

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 18 Sep 2019 09:19:58 -0600
parents 27efb1fcbcb5
children dc625408def8
comparison
equal deleted inserted replaced
1405:546edc2df02c 1406:8187ddb0e827
888 { 888 {
889 writer.addDocument(toLucene(doc,null)); 889 writer.addDocument(toLucene(doc,null));
890 } 890 }
891 891
892 public void check(LuanFunction completer) throws IOException, SQLException, LuanException { 892 public void check(LuanFunction completer) throws IOException, SQLException, LuanException {
893 luanLogger.info("start check"); 893 boolean hasPostgres = postgresBackup != null;
894 String msg = "start check";
895 if( hasPostgres )
896 msg += " with postgres";
897 luanLogger.info(msg);
894 CheckIndex.Status status = new CheckIndex(fsDir).checkIndex(); 898 CheckIndex.Status status = new CheckIndex(fsDir).checkIndex();
895 if( !status.clean ) 899 if( !status.clean )
896 luanLogger.error("index not clean"); 900 luanLogger.error("index not clean");
897 if( postgresBackup != null ) 901 if( hasPostgres )
898 checkPostgres(completer); 902 checkPostgres(completer);
899 luanLogger.info("end check"); 903 luanLogger.info("end check");
900 } 904 }
901 905
902 private void checkPostgres(LuanFunction completer) throws IOException, SQLException, LuanException { 906 private void checkPostgres(LuanFunction completer) throws IOException, SQLException, LuanException {
903 luanLogger.info("start postgres check"); 907 //luanLogger.info("start postgres check");
904 final PostgresBackup.Checker postgresChecker; 908 final PostgresBackup.Checker postgresChecker;
905 final IndexSearcher searcher; 909 final IndexSearcher searcher;
906 writeLock.lock(); 910 writeLock.lock();
907 try { 911 try {
908 postgresChecker = postgresBackup.newChecker(); 912 postgresChecker = postgresBackup.newChecker();