This commit is contained in:
chimp1984 2021-01-11 13:38:03 -05:00
parent 026858d8b1
commit 873b557ce8
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -53,6 +53,7 @@ public class RemovedPayloadsService implements PersistedDataHost {
persisted.getDateByHashes().entrySet().stream()
.filter(e -> e.getValue() < cutOffDate)
.forEach(e -> removedPayloadsMap.getDateByHashes().put(e.getKey(), e.getValue()));
log.trace("readPersisted: removedPayloadsMap={}", removedPayloadsMap);
persistenceManager.requestPersistence();
completeHandler.run();
},
@ -60,10 +61,12 @@ public class RemovedPayloadsService implements PersistedDataHost {
}
public boolean wasRemoved(P2PDataStorage.ByteArray hashOfPayload) {
log.trace("called wasRemoved: hashOfPayload={}, removedPayloadsMap={}", hashOfPayload.toString(), removedPayloadsMap);
return removedPayloadsMap.getDateByHashes().containsKey(hashOfPayload);
}
public void addHash(P2PDataStorage.ByteArray hashOfPayload) {
log.trace("called addHash: hashOfPayload={}, removedPayloadsMap={}", hashOfPayload.toString(), removedPayloadsMap);
removedPayloadsMap.getDateByHashes().put(hashOfPayload, System.currentTimeMillis());
persistenceManager.requestPersistence();
}