mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 11:52:59 +03:00
Disable Graal-based Ydoc temporarily (#10627)
Graal Ydoc implementation is currently not being used locally or in the cloud and giving an impression of a slower startup. Plus it appears that there some issues in the local connection as well. To limit the impact of it now, let's make it controllable by the same env variable as GUI is.
This commit is contained in:
parent
8af3fd42b9
commit
aae8370977
@ -11,6 +11,7 @@ public final class YdocInitialization extends LockedInitialization {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
private final ComponentSupervisor supervisor;
|
||||
private final String ENABLED_YDOC = "POLYGLOT_YDOC_SERVER";
|
||||
|
||||
public YdocInitialization(Executor executor, ComponentSupervisor componentSupervisor) {
|
||||
super(executor);
|
||||
@ -19,19 +20,27 @@ public final class YdocInitialization extends LockedInitialization {
|
||||
|
||||
@Override
|
||||
public void initComponent() {
|
||||
logger.debug("Starting Ydoc server...");
|
||||
var applicationConfig = ApplicationConfig.load();
|
||||
var ydoc =
|
||||
Ydoc.builder()
|
||||
.hostname(applicationConfig.ydoc().hostname())
|
||||
.port(applicationConfig.ydoc().port())
|
||||
.build();
|
||||
try {
|
||||
ydoc.start();
|
||||
this.supervisor.registerService(ydoc);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
var ydocEnabled =
|
||||
System.getenv(ENABLED_YDOC) == null
|
||||
? false
|
||||
: Boolean.parseBoolean(System.getenv(ENABLED_YDOC));
|
||||
if (ydocEnabled) {
|
||||
logger.debug("Starting Ydoc server...");
|
||||
var applicationConfig = ApplicationConfig.load();
|
||||
var ydoc =
|
||||
Ydoc.builder()
|
||||
.hostname(applicationConfig.ydoc().hostname())
|
||||
.port(applicationConfig.ydoc().port())
|
||||
.build();
|
||||
try {
|
||||
ydoc.start();
|
||||
this.supervisor.registerService(ydoc);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
logger.debug("Started Ydoc server");
|
||||
} else {
|
||||
logger.debug("Reverting to Node.js Ydoc");
|
||||
}
|
||||
logger.debug("Started Ydoc server.");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user