Commit 76bd56d9 by 张乐

Merge pull request #258 from nobodyiam/client-app-id-not-set

prevent crash when app.id is not set
parents a0bee9d4 8737d49c
...@@ -259,15 +259,22 @@ public class RemoteConfigRepository extends AbstractConfigRepository { ...@@ -259,15 +259,22 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
} }
private void scheduleLongPollingRefresh() { private void scheduleLongPollingRefresh() {
final String appId = m_configUtil.getAppId(); try {
final String cluster = m_configUtil.getCluster(); final String appId = m_configUtil.getAppId();
final String dataCenter = m_configUtil.getDataCenter(); final String cluster = m_configUtil.getCluster();
m_longPollingService.submit(new Runnable() { final String dataCenter = m_configUtil.getDataCenter();
@Override m_longPollingService.submit(new Runnable() {
public void run() { @Override
doLongPollingRefresh(appId, cluster, dataCenter); public void run() {
} doLongPollingRefresh(appId, cluster, dataCenter);
}); }
});
} catch (Throwable ex) {
ApolloConfigException exception =
new ApolloConfigException("Schedule long polling refresh failed", ex);
Cat.logError(exception);
logger.warn(ExceptionUtil.getDetailMessage(exception));
}
} }
private void doLongPollingRefresh(String appId, String cluster, String dataCenter) { private void doLongPollingRefresh(String appId, String cluster, String dataCenter) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment