From 02d163f5dc608fbc7d27c6f53deb2b4e7896cf22 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 15 Dec 2020 00:56:06 -0500 Subject: [PATCH] Only log in case the operation took longer than 100 ms --- .../bisq/common/persistence/PersistenceManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/bisq/common/persistence/PersistenceManager.java b/common/src/main/java/bisq/common/persistence/PersistenceManager.java index 8300e9c336..27fffacdad 100644 --- a/common/src/main/java/bisq/common/persistence/PersistenceManager.java +++ b/common/src/main/java/bisq/common/persistence/PersistenceManager.java @@ -375,7 +375,10 @@ public class PersistenceManager { // reference to the persistable object. getWriteToDiskExecutor().execute(() -> writeToDisk(serialized, completeHandler)); - log.info("Serializing {} took {} msec", fileName, System.currentTimeMillis() - ts); + long duration = System.currentTimeMillis() - ts; + if (duration > 100) { + log.info("Serializing {} took {} msec", fileName, duration); + } } catch (Throwable e) { log.error("Error in saveToFile toProtoMessage: {}, {}", persistable.getClass().getSimpleName(), fileName); e.printStackTrace(); @@ -437,7 +440,10 @@ public class PersistenceManager { e.printStackTrace(); log.error("Cannot close resources." + e.getMessage()); } - log.info("Writing the serialized {} completed in {} msec", fileName, System.currentTimeMillis() - ts); + long duration = System.currentTimeMillis() - ts; + if (duration > 100) { + log.info("Writing the serialized {} completed in {} msec", fileName, duration); + } persistenceRequested = false; if (completeHandler != null) { UserThread.execute(completeHandler);