mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
commit
7d9a53adc9
13 changed files with 76 additions and 69 deletions
|
@ -19,7 +19,7 @@ package bisq.core;
|
||||||
|
|
||||||
import bisq.core.alert.AlertModule;
|
import bisq.core.alert.AlertModule;
|
||||||
import bisq.core.app.AppOptionKeys;
|
import bisq.core.app.AppOptionKeys;
|
||||||
import bisq.core.app.AvoidStandbyMode;
|
import bisq.core.app.AvoidStandbyModeService;
|
||||||
import bisq.core.app.BisqEnvironment;
|
import bisq.core.app.BisqEnvironment;
|
||||||
import bisq.core.app.BisqFacade;
|
import bisq.core.app.BisqFacade;
|
||||||
import bisq.core.app.BisqSetup;
|
import bisq.core.app.BisqSetup;
|
||||||
|
@ -94,7 +94,7 @@ public class CoreModule extends AppModule {
|
||||||
bind(Preferences.class).in(Singleton.class);
|
bind(Preferences.class).in(Singleton.class);
|
||||||
bind(BridgeAddressProvider.class).to(Preferences.class).in(Singleton.class);
|
bind(BridgeAddressProvider.class).to(Preferences.class).in(Singleton.class);
|
||||||
bind(CorruptedDatabaseFilesHandler.class).in(Singleton.class);
|
bind(CorruptedDatabaseFilesHandler.class).in(Singleton.class);
|
||||||
bind(AvoidStandbyMode.class).in(Singleton.class);
|
bind(AvoidStandbyModeService.class).in(Singleton.class);
|
||||||
|
|
||||||
bind(SeedNodeAddressLookup.class).in(Singleton.class);
|
bind(SeedNodeAddressLookup.class).in(Singleton.class);
|
||||||
bind(SeedNodeRepository.class).to(DefaultSeedNodeRepository.class).in(Singleton.class);
|
bind(SeedNodeRepository.class).to(DefaultSeedNodeRepository.class).in(Singleton.class);
|
||||||
|
|
|
@ -40,18 +40,18 @@ import javax.sound.sampled.DataLine;
|
||||||
import javax.sound.sampled.SourceDataLine;
|
import javax.sound.sampled.SourceDataLine;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AvoidStandbyMode {
|
public class AvoidStandbyModeService {
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private volatile boolean isStopped;
|
private volatile boolean isStopped;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AvoidStandbyMode(Preferences preferences) {
|
public AvoidStandbyModeService(Preferences preferences) {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
|
|
||||||
preferences.getUseStandbyModeProperty().addListener((observable, oldValue, newValue) -> {
|
preferences.getUseStandbyModeProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
isStopped = true;
|
isStopped = true;
|
||||||
log.info("AvoidStandbyMode stopped");
|
log.info("AvoidStandbyModeService stopped");
|
||||||
} else {
|
} else {
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
|
@ -67,9 +67,9 @@ public class AvoidStandbyMode {
|
||||||
|
|
||||||
private void start() {
|
private void start() {
|
||||||
isStopped = false;
|
isStopped = false;
|
||||||
log.info("AvoidStandbyMode started");
|
log.info("AvoidStandbyModeService started");
|
||||||
Thread thread = new Thread(this::play);
|
Thread thread = new Thread(this::play);
|
||||||
thread.setName("AvoidStandbyMode-thread");
|
thread.setName("AvoidStandbyModeService-thread");
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,7 +405,6 @@ public class BisqSetup {
|
||||||
step3();
|
step3();
|
||||||
});
|
});
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.info("Localhost Bitcoin node not detected.");
|
|
||||||
UserThread.execute(BisqSetup.this::step3);
|
UserThread.execute(BisqSetup.this::step3);
|
||||||
} finally {
|
} finally {
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
|
|
|
@ -77,8 +77,6 @@ public class P2PNetworkSetup {
|
||||||
}
|
}
|
||||||
|
|
||||||
BooleanProperty init(Runnable initWalletServiceHandler, @Nullable Consumer<Boolean> displayTorNetworkSettingsHandler) {
|
BooleanProperty init(Runnable initWalletServiceHandler, @Nullable Consumer<Boolean> displayTorNetworkSettingsHandler) {
|
||||||
log.info("init");
|
|
||||||
|
|
||||||
StringProperty bootstrapState = new SimpleStringProperty();
|
StringProperty bootstrapState = new SimpleStringProperty();
|
||||||
StringProperty bootstrapWarning = new SimpleStringProperty();
|
StringProperty bootstrapWarning = new SimpleStringProperty();
|
||||||
BooleanProperty hiddenServicePublished = new SimpleBooleanProperty();
|
BooleanProperty hiddenServicePublished = new SimpleBooleanProperty();
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class MobileModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyKeyAndToken(String keyAndToken) {
|
public void applyKeyAndToken(String keyAndToken) {
|
||||||
log.info("phoneId={}", keyAndToken);
|
log.info("applyKeyAndToken: keyAndToken={}", keyAndToken.substring(0, 20) + "...(truncated in log for privacy reasons)");
|
||||||
String[] tokens = keyAndToken.split(PHONE_SEPARATOR_ESCAPED);
|
String[] tokens = keyAndToken.split(PHONE_SEPARATOR_ESCAPED);
|
||||||
String magic = tokens[0];
|
String magic = tokens[0];
|
||||||
descriptor = tokens[1];
|
descriptor = tokens[1];
|
||||||
|
|
|
@ -130,8 +130,7 @@ public class MobileNotificationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendMessage(MobileMessage message, boolean useSound) throws Exception {
|
public boolean sendMessage(MobileMessage message, boolean useSound) throws Exception {
|
||||||
log.info("sendMessage\n" +
|
log.info("Send message: '{}'", message.getMessage());
|
||||||
"Title: " + message.getTitle() + "\nMessage: " + message.getMessage());
|
|
||||||
if (mobileModel.getKey() == null)
|
if (mobileModel.getKey() == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import bisq.desktop.util.ImageUtil;
|
||||||
|
|
||||||
import bisq.core.alert.AlertManager;
|
import bisq.core.alert.AlertManager;
|
||||||
import bisq.core.app.AppOptionKeys;
|
import bisq.core.app.AppOptionKeys;
|
||||||
import bisq.core.app.AvoidStandbyMode;
|
import bisq.core.app.AvoidStandbyModeService;
|
||||||
import bisq.core.app.BisqEnvironment;
|
import bisq.core.app.BisqEnvironment;
|
||||||
import bisq.core.btc.wallet.BtcWalletService;
|
import bisq.core.btc.wallet.BtcWalletService;
|
||||||
import bisq.core.btc.wallet.WalletsManager;
|
import bisq.core.btc.wallet.WalletsManager;
|
||||||
|
@ -131,7 +131,7 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
|
||||||
scene = createAndConfigScene(mainView, injector);
|
scene = createAndConfigScene(mainView, injector);
|
||||||
setupStage(scene);
|
setupStage(scene);
|
||||||
|
|
||||||
injector.getInstance(AvoidStandbyMode.class).init();
|
injector.getInstance(AvoidStandbyModeService.class).init();
|
||||||
|
|
||||||
UserThread.runPeriodically(() -> Profiler.printSystemLoad(log), LOG_MEMORY_PERIOD_MIN, TimeUnit.MINUTES);
|
UserThread.runPeriodically(() -> Profiler.printSystemLoad(log), LOG_MEMORY_PERIOD_MIN, TimeUnit.MINUTES);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
|
@ -312,7 +312,7 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
|
||||||
|
|
||||||
// We show a popup to inform user that open offers will be removed if Bisq is not running.
|
// We show a popup to inform user that open offers will be removed if Bisq is not running.
|
||||||
String key = "showOpenOfferWarnPopupAtShutDown";
|
String key = "showOpenOfferWarnPopupAtShutDown";
|
||||||
if (injector.getInstance(Preferences.class).showAgain(key)) {
|
if (injector.getInstance(Preferences.class).showAgain(key) && !DevEnv.isDevMode()) {
|
||||||
new Popup<>().information(Res.get("popup.info.shutDownWithOpenOffers"))
|
new Popup<>().information(Res.get("popup.info.shutDownWithOpenOffers"))
|
||||||
.dontShowAgainId(key)
|
.dontShowAgainId(key)
|
||||||
.useShutDownButton()
|
.useShutDownButton()
|
||||||
|
|
|
@ -57,6 +57,7 @@ import bisq.core.util.BSFormatter;
|
||||||
|
|
||||||
import bisq.network.p2p.NodeAddress;
|
import bisq.network.p2p.NodeAddress;
|
||||||
|
|
||||||
|
import bisq.common.app.DevEnv;
|
||||||
import bisq.common.util.Tuple3;
|
import bisq.common.util.Tuple3;
|
||||||
|
|
||||||
import org.bitcoinj.core.Coin;
|
import org.bitcoinj.core.Coin;
|
||||||
|
@ -393,7 +394,7 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
|
||||||
Res.get("popup.warning.noTradingAccountSetup.msg"),
|
Res.get("popup.warning.noTradingAccountSetup.msg"),
|
||||||
FiatAccountsView.class,
|
FiatAccountsView.class,
|
||||||
"navigation.account");
|
"navigation.account");
|
||||||
} else if (!model.hasPaymentAccountForCurrency()) {
|
} else if (!model.hasPaymentAccountForCurrency() && !DevEnv.isDevMode()) {
|
||||||
new Popup<>().headLine(Res.get("offerbook.warning.noTradingAccountForCurrency.headline"))
|
new Popup<>().headLine(Res.get("offerbook.warning.noTradingAccountForCurrency.headline"))
|
||||||
.instruction(Res.get("offerbook.warning.noTradingAccountForCurrency.msg"))
|
.instruction(Res.get("offerbook.warning.noTradingAccountForCurrency.msg"))
|
||||||
.actionButtonText(Res.get("offerbook.yesCreateOffer"))
|
.actionButtonText(Res.get("offerbook.yesCreateOffer"))
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
|
||||||
referralIdService.setReferralId(newValue);
|
referralIdService.setReferralId(newValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
// AvoidStandbyMode
|
// AvoidStandbyModeService
|
||||||
avoidStandbyModeCheckBox = addLabelCheckBox(root, ++gridRow,
|
avoidStandbyModeCheckBox = addLabelCheckBox(root, ++gridRow,
|
||||||
Res.get("setting.preferences.avoidStandbyMode"), "").second;
|
Res.get("setting.preferences.avoidStandbyMode"), "").second;
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,19 +197,12 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
public void onAllServicesInitialized() {
|
public void onAllServicesInitialized() {
|
||||||
Log.traceCall();
|
Log.traceCall();
|
||||||
if (networkNode.getNodeAddress() != null) {
|
if (networkNode.getNodeAddress() != null) {
|
||||||
p2PDataStorage.getMap().values().stream().forEach(protectedStorageEntry -> {
|
maybeProcessAllMailboxEntries();
|
||||||
if (protectedStorageEntry instanceof ProtectedMailboxStorageEntry)
|
|
||||||
processProtectedMailboxStorageEntry((ProtectedMailboxStorageEntry) protectedStorageEntry);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// If our HS is still not published
|
// If our HS is still not published
|
||||||
networkNode.nodeAddressProperty().addListener((observable, oldValue, newValue) -> {
|
networkNode.nodeAddressProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
if (newValue != null) {
|
if (newValue != null)
|
||||||
p2PDataStorage.getMap().values().stream().forEach(protectedStorageEntry -> {
|
maybeProcessAllMailboxEntries();
|
||||||
if (protectedStorageEntry instanceof ProtectedMailboxStorageEntry)
|
|
||||||
processProtectedMailboxStorageEntry((ProtectedMailboxStorageEntry) protectedStorageEntry);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,6 +284,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
|
|
||||||
if (!seedNodesAvailable) {
|
if (!seedNodesAvailable) {
|
||||||
isBootstrapped = true;
|
isBootstrapped = true;
|
||||||
|
maybeProcessAllMailboxEntries();
|
||||||
p2pServiceListeners.stream().forEach(P2PServiceListener::onNoSeedNodeAvailable);
|
p2pServiceListeners.stream().forEach(P2PServiceListener::onNoSeedNodeAvailable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -354,6 +348,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
public void onUpdatedDataReceived() {
|
public void onUpdatedDataReceived() {
|
||||||
if (!isBootstrapped) {
|
if (!isBootstrapped) {
|
||||||
isBootstrapped = true;
|
isBootstrapped = true;
|
||||||
|
maybeProcessAllMailboxEntries();
|
||||||
p2pServiceListeners.stream().forEach(P2PServiceListener::onUpdatedDataReceived);
|
p2pServiceListeners.stream().forEach(P2PServiceListener::onUpdatedDataReceived);
|
||||||
p2PDataStorage.onBootstrapComplete();
|
p2PDataStorage.onBootstrapComplete();
|
||||||
}
|
}
|
||||||
|
@ -449,7 +444,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
@Override
|
@Override
|
||||||
public void onAdded(ProtectedStorageEntry protectedStorageEntry) {
|
public void onAdded(ProtectedStorageEntry protectedStorageEntry) {
|
||||||
if (protectedStorageEntry instanceof ProtectedMailboxStorageEntry)
|
if (protectedStorageEntry instanceof ProtectedMailboxStorageEntry)
|
||||||
processProtectedMailboxStorageEntry((ProtectedMailboxStorageEntry) protectedStorageEntry);
|
processMailboxEntry((ProtectedMailboxStorageEntry) protectedStorageEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -523,9 +518,8 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
// MailboxMessages
|
// MailboxMessages
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void processProtectedMailboxStorageEntry(ProtectedMailboxStorageEntry protectedMailboxStorageEntry) {
|
private void processMailboxEntry(ProtectedMailboxStorageEntry protectedMailboxStorageEntry) {
|
||||||
Log.traceCall();
|
NodeAddress nodeAddress = networkNode.getNodeAddress();
|
||||||
final NodeAddress nodeAddress = networkNode.getNodeAddress();
|
|
||||||
// Seed nodes don't receive mailbox network_messages
|
// Seed nodes don't receive mailbox network_messages
|
||||||
if (nodeAddress != null && !seedNodeRepository.isSeedNode(nodeAddress)) {
|
if (nodeAddress != null && !seedNodeRepository.isSeedNode(nodeAddress)) {
|
||||||
Log.traceCall();
|
Log.traceCall();
|
||||||
|
@ -541,8 +535,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
checkNotNull(senderNodeAddress, "senderAddress must not be null for mailbox network_messages");
|
checkNotNull(senderNodeAddress, "senderAddress must not be null for mailbox network_messages");
|
||||||
|
|
||||||
mailboxMap.put(mailboxMessage.getUid(), protectedMailboxStorageEntry);
|
mailboxMap.put(mailboxMessage.getUid(), protectedMailboxStorageEntry);
|
||||||
log.trace("Decryption of SealedAndSignedMessage succeeded. senderAddress="
|
log.info("Received a {} mailbox message with messageUid {} and senderAddress {}", mailboxMessage.getClass().getSimpleName(), mailboxMessage.getUid(), senderNodeAddress);
|
||||||
+ senderNodeAddress + " / my address=" + getAddress());
|
|
||||||
decryptedMailboxListeners.forEach(
|
decryptedMailboxListeners.forEach(
|
||||||
e -> e.onMailboxMessageAdded(decryptedMessageWithPubKey, senderNodeAddress));
|
e -> e.onMailboxMessageAdded(decryptedMessageWithPubKey, senderNodeAddress));
|
||||||
} else {
|
} else {
|
||||||
|
@ -660,6 +653,14 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void maybeProcessAllMailboxEntries() {
|
||||||
|
if (isBootstrapped) {
|
||||||
|
p2PDataStorage.getMap().values().forEach(protectedStorageEntry -> {
|
||||||
|
if (protectedStorageEntry instanceof ProtectedMailboxStorageEntry)
|
||||||
|
processMailboxEntry((ProtectedMailboxStorageEntry) protectedStorageEntry);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void addMailboxData(MailboxStoragePayload expirableMailboxStoragePayload,
|
private void addMailboxData(MailboxStoragePayload expirableMailboxStoragePayload,
|
||||||
PublicKey receiversPublicKey,
|
PublicKey receiversPublicKey,
|
||||||
|
@ -755,7 +756,12 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
|
|
||||||
private void delayedRemoveEntryFromMailbox(DecryptedMessageWithPubKey decryptedMessageWithPubKey) {
|
private void delayedRemoveEntryFromMailbox(DecryptedMessageWithPubKey decryptedMessageWithPubKey) {
|
||||||
Log.traceCall();
|
Log.traceCall();
|
||||||
if (isBootstrapped()) {
|
if (!isBootstrapped()) {
|
||||||
|
// We don't throw an NetworkNotReadyException here.
|
||||||
|
// This case should not happen anyway as we check for isBootstrapped in the callers.
|
||||||
|
log.warn("You must have bootstrapped before adding data to the P2P network.");
|
||||||
|
}
|
||||||
|
|
||||||
MailboxMessage mailboxMessage = (MailboxMessage) decryptedMessageWithPubKey.getNetworkEnvelope();
|
MailboxMessage mailboxMessage = (MailboxMessage) decryptedMessageWithPubKey.getNetworkEnvelope();
|
||||||
String uid = mailboxMessage.getUid();
|
String uid = mailboxMessage.getUid();
|
||||||
if (mailboxMap.containsKey(uid)) {
|
if (mailboxMap.containsKey(uid)) {
|
||||||
|
@ -781,10 +787,6 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||||
} else {
|
} else {
|
||||||
log.warn("uid for mailbox entry not found in mailboxMap." + "uid={}", uid);
|
log.warn("uid for mailbox entry not found in mailboxMap." + "uid={}", uid);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new NetworkNotReadyException();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -178,9 +178,20 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
|
||||||
@Override
|
@Override
|
||||||
public void readPersisted() {
|
public void readPersisted() {
|
||||||
PeerList persistedPeerList = storage.initAndGetPersistedWithFileName("PeerList", 1000);
|
PeerList persistedPeerList = storage.initAndGetPersistedWithFileName("PeerList", 1000);
|
||||||
if (persistedPeerList != null)
|
if (persistedPeerList != null) {
|
||||||
|
long peesWithNoCapabilitiesSet = persistedPeerList.getList().stream()
|
||||||
|
.filter(e -> e.getSupportedCapabilities().isEmpty())
|
||||||
|
.mapToInt(e -> 1)
|
||||||
|
.count();
|
||||||
|
if (peesWithNoCapabilitiesSet > 100) {
|
||||||
|
log.warn("peesWithNoCapabilitiesSet={}, persistedPeerList.size()={}", peesWithNoCapabilitiesSet, persistedPeerList.size());
|
||||||
|
} else {
|
||||||
|
log.info("peesWithNoCapabilitiesSet={}, persistedPeerList.size()={}", peesWithNoCapabilitiesSet, persistedPeerList.size());
|
||||||
|
}
|
||||||
|
|
||||||
this.persistedPeers.addAll(persistedPeerList.getList());
|
this.persistedPeers.addAll(persistedPeerList.getList());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getMaxConnections() {
|
public int getMaxConnections() {
|
||||||
return maxConnectionsAbsolute;
|
return maxConnectionsAbsolute;
|
||||||
|
@ -648,7 +659,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
|
||||||
.filter(peer -> peer.getDate().getTime() > maxAge)
|
.filter(peer -> peer.getDate().getTime() > maxAge)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
if (oldNumLatestLivePeers != latestLivePeers.size())
|
if (oldNumLatestLivePeers != latestLivePeers.size())
|
||||||
log.info("Num of latestLivePeers={}, latestLivePeers={}", latestLivePeers.size(), latestLivePeers);
|
log.info("Num of latestLivePeers={}", latestLivePeers.size());
|
||||||
return latestLivePeers;
|
return latestLivePeers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,6 @@ public final class Peer implements NetworkPayload, PersistablePayload, Supported
|
||||||
this.nodeAddress = nodeAddress;
|
this.nodeAddress = nodeAddress;
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.supportedCapabilities = supportedCapabilities;
|
this.supportedCapabilities = supportedCapabilities;
|
||||||
|
|
||||||
if (supportedCapabilities.isEmpty())
|
|
||||||
log.warn("SupportedCapabilities is empty. nodeAddress={}", nodeAddress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -139,9 +139,9 @@ public abstract class StoreService<T extends PersistableEnvelope, R extends Pers
|
||||||
final String fileName = getFileName();
|
final String fileName = getFileName();
|
||||||
store = storage.initAndGetPersistedWithFileName(fileName, 100);
|
store = storage.initAndGetPersistedWithFileName(fileName, 100);
|
||||||
if (store != null) {
|
if (store != null) {
|
||||||
log.info("{}: size of {}: {} kb", this.getClass().getSimpleName(),
|
log.info("{}: size of {}: {} MB", this.getClass().getSimpleName(),
|
||||||
storage.getClass().getSimpleName(),
|
storage.getClass().getSimpleName(),
|
||||||
store.toProtoMessage().toByteArray().length / 100D);
|
store.toProtoMessage().toByteArray().length / 1_000_000D);
|
||||||
} else {
|
} else {
|
||||||
store = createStore();
|
store = createStore();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue