提交 70e6c203 编写于 作者: 彭勇升 pengys 提交者: wu-sheng

Shutdown the OAP server when catch any exception. (#2352)

上级 0951b943
......@@ -20,7 +20,7 @@ package org.apache.skywalking.oap.server.starter;
import org.apache.skywalking.oap.server.core.RunningMode;
import org.apache.skywalking.oap.server.library.module.*;
import org.apache.skywalking.oap.server.starter.config.*;
import org.apache.skywalking.oap.server.starter.config.ApplicationConfigLoader;
import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
import org.apache.skywalking.oap.server.telemetry.api.*;
import org.slf4j.*;
......@@ -45,14 +45,14 @@ public class OAPServerStartUp {
manager.find(TelemetryModule.NAME).provider().getService(MetricCreator.class).createGauge("uptime",
"oap server start up time", MetricTag.EMPTY_KEY, MetricTag.EMPTY_VALUE)
// Set uptime to second
.setValue(System.currentTimeMillis() / 1000);
.setValue(System.currentTimeMillis() / 1000d);
if (RunningMode.isInitMode()) {
logger.info("OAP starts up in init mode successfully, exit now...");
System.exit(0);
}
} catch (ConfigFileNotFoundException | ModuleNotFoundException | ProviderNotFoundException | ServiceNotProvidedException | ModuleConfigException | ModuleStartException e) {
logger.error(e.getMessage(), e);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
System.exit(1);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册