[bisq-network/bisq] Persist and republish mailbox messages (#5072)

chimp1984 notifications at github.com
Tue Jan 12 16:54:58 CET 2021


@chimp1984 commented on this pull request.



> +        this.persistenceManager = persistenceManager;
+
+        this.persistenceManager.initialize(removedPayloadsMap, PersistenceManager.Source.PRIVATE_LOW_PRIO);
+    }
+
+
+    ///////////////////////////////////////////////////////////////////////////////////////////
+    // PersistedDataHost
+    ///////////////////////////////////////////////////////////////////////////////////////////
+
+    @Override
+    public void readPersisted(Runnable completeHandler) {
+        long cutOffDate = System.currentTimeMillis() - MailboxStoragePayload.TTL;
+        persistenceManager.readPersisted(persisted -> {
+                    persisted.getDateByHashes().entrySet().stream()
+                            .filter(e -> e.getValue() < cutOffDate)

Ups that is wrong. Should `>`. It cleans out old entries so it does not grow endlessly.
The class it to persist the remove call so we do not add again removed mailbox messages. I will add some comments as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5072#discussion_r555880299
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210112/43261a1f/attachment.htm>


More information about the bisq-github mailing list