IDEA: fix starting daemon with specified amount of memory

This commit is contained in:
Alexey Andreev 2018-08-30 11:11:15 +03:00
parent 773d40aa37
commit 8c35ef0189

View File

@ -68,7 +68,7 @@ public class TeaVMDaemonComponent implements ApplicationComponent {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
updateConfiguration(true, daemonMemory); updateConfiguration(true);
} }
} }
@ -76,7 +76,7 @@ public class TeaVMDaemonComponent implements ApplicationComponent {
if (daemonInfo != null) { if (daemonInfo != null) {
daemonInfo.getProcess().destroy(); daemonInfo.getProcess().destroy();
daemonInfo = null; daemonInfo = null;
updateConfiguration(false, daemonMemory); updateConfiguration(false);
} }
} }
@ -104,11 +104,10 @@ public class TeaVMDaemonComponent implements ApplicationComponent {
configurationStorage.loadState(configuration); configurationStorage.loadState(configuration);
} }
private void updateConfiguration(boolean daemonEnabled, int daemonMemory) { private void updateConfiguration(boolean daemonEnabled) {
TeaVMWorkspaceConfigurationStorage configurationStorage = getConfigurationStorage(); TeaVMWorkspaceConfigurationStorage configurationStorage = getConfigurationStorage();
TeaVMJpsWorkspaceConfiguration configuration = configurationStorage.getState(); TeaVMJpsWorkspaceConfiguration configuration = configurationStorage.getState();
configuration.setDaemonEnabled(daemonEnabled); configuration.setDaemonEnabled(daemonEnabled);
configuration.setDaemonMemory(daemonMemory);
configurationStorage.loadState(configuration); configurationStorage.loadState(configuration);
} }