Remove torSetup.cleanupTorFiles() call.

This has caused the slow tor startup of about 20-30 sec. Without that it is about 5 sec.
This commit is contained in:
chimp1984 2020-10-23 01:14:29 -05:00
parent c0f981ad1d
commit 87bf30b98c
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
3 changed files with 1 additions and 11 deletions

View file

@ -260,7 +260,6 @@ public class BisqSetup {
} }
private void step2() { private void step2() {
torSetup.cleanupTorFiles();
readMapsFromResources(this::step3); readMapsFromResources(this::step3);
checkForCorrectOSArchitecture(); checkForCorrectOSArchitecture();
checkOSXVersion(); checkOSXVersion();

View file

@ -46,15 +46,7 @@ public class TorSetup {
this.torDir = checkDir(torDir); this.torDir = checkDir(torDir);
} }
public void cleanupTorFiles() { // Should only be called if needed. Slows down Tor startup from about 5 sec. to 30 sec. if it gets deleted.
cleanupTorFiles(null, null);
}
// We get sometimes Tor startup problems which is related to some tor files in the tor directory. It happens
// more often if the application got killed (not graceful shutdown).
// Creating all tor files newly takes about 3-4 sec. longer and it does not benefit from cache files.
// TODO: We should fix those startup problems in the netlayer library, once fixed there we can remove that call at the
// Bisq startup again.
public void cleanupTorFiles(@Nullable Runnable resultHandler, @Nullable ErrorMessageHandler errorMessageHandler) { public void cleanupTorFiles(@Nullable Runnable resultHandler, @Nullable ErrorMessageHandler errorMessageHandler) {
File hiddenservice = new File(Paths.get(torDir.getAbsolutePath(), "hiddenservice").toString()); File hiddenservice = new File(Paths.get(torDir.getAbsolutePath(), "hiddenservice").toString());
try { try {

View file

@ -73,7 +73,6 @@ public class AppSetupWithP2P extends AppSetup {
@Override @Override
public void initPersistedDataHosts() { public void initPersistedDataHosts() {
torSetup.cleanupTorFiles();
persistedDataHosts.add(p2PService); persistedDataHosts.add(p2PService);
// we apply at startup the reading of persisted data but don't want to get it triggered in the constructor // we apply at startup the reading of persisted data but don't want to get it triggered in the constructor