Mercurial Hosting > luan
diff src/goodjava/lucene/backup/BackupIndexWriter.java @ 1799:1578324d2aac
backup logging
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 22 Feb 2024 08:34:55 -0700 |
parents | 973d3039c421 |
children |
line wrap: on
line diff
--- a/src/goodjava/lucene/backup/BackupIndexWriter.java Thu Feb 22 08:08:07 2024 -0700 +++ b/src/goodjava/lucene/backup/BackupIndexWriter.java Thu Feb 22 08:34:55 2024 -0700 @@ -22,6 +22,7 @@ import goodjava.rpc.RpcCall; import goodjava.rpc.RpcResult; import goodjava.rpc.RpcException; +import goodjava.rpc.RpcError; import goodjava.lucene.api.LuceneIndexWriter; import goodjava.lucene.logging.LoggingIndexWriter; import goodjava.lucene.logging.LogFile; @@ -60,7 +61,7 @@ super.commit(); //sync(); if( !isSyncPending ) { - exec.execute(sync); + exec.execute(syncR); isSyncPending = true; } } @@ -73,14 +74,14 @@ } public void runSync() { - exec(sync); + execR(syncR); } public void runSyncWithChecksum() { - exec(syncWithChecksum); + execR(syncWithChecksum); } - private void exec(Runnable r) { + private void execR(Runnable r) { try { exec.submit(r).get(); } catch(InterruptedException e) { @@ -93,7 +94,7 @@ } } - private final Runnable sync = new Runnable() { + private final Runnable syncR = new Runnable() { public void run() { try { sync(false); @@ -101,6 +102,9 @@ logger.error("sync failed: "+e.getMessage()); } catch(IOException e) { throw new RuntimeException(e); + } catch(RpcError e) { + logger.error("",e); + throw e; } } };