Added logs to monitor
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/document-store-lib@124584 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2cecc83a0d
commit
afa0e6719a
|
@ -85,12 +85,17 @@ public class PersistenceBackendMonitor implements Runnable {
|
|||
}
|
||||
|
||||
protected synchronized void elaborateFallbackFile(File file){
|
||||
logger.trace("Trying to persist {}s which failed and were persisted using fallback on file {}",
|
||||
Record.class.getSimpleName(), file.getAbsoluteFile());
|
||||
File elaborationFile = null;
|
||||
|
||||
if(file.exists()){
|
||||
Long timestamp = Calendar.getInstance().getTimeInMillis();
|
||||
elaborationFile = new File(file.getAbsolutePath() + ELABORATION_FILE_SUFFIX + "." + timestamp.toString());
|
||||
logger.trace("Going to move fallaback file ({}) to elaboration file ({})",
|
||||
file.getAbsolutePath(), elaborationFile.getAbsolutePath());
|
||||
file.renameTo(elaborationFile);
|
||||
|
||||
}
|
||||
|
||||
if(elaborationFile!=null){
|
||||
|
@ -111,11 +116,8 @@ public class PersistenceBackendMonitor implements Runnable {
|
|||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
logger.debug("Trying to persist {}s which failed and were persisted using fallback", Record.class.getSimpleName());
|
||||
|
||||
FallbackPersistenceBackend fallbackPersistenceBackend = persistenceBackend.getFallbackPersistence();
|
||||
File file = fallbackPersistenceBackend.getFallbackFile();
|
||||
|
||||
File file = new File(fallbackPersistenceBackend.getFallbackFile().getAbsolutePath());
|
||||
elaborateFallbackFile(file);
|
||||
manageOldAccountingFile();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue