Mercurial Hosting > luan
changeset 1799:1578324d2aac
backup logging
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 22 Feb 2024 08:34:55 -0700 |
parents | f8eba0442956 |
children | a045f30fa67d |
files | src/goodjava/lucene/backup/BackupIndexWriter.java |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
diff -r f8eba0442956 -r 1578324d2aac src/goodjava/lucene/backup/BackupIndexWriter.java --- 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; } } };