Skip to content

Commit

Permalink
Merge 9e37f7f into a565fda
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaaaaaron committed Jul 11, 2018
2 parents a565fda + 9e37f7f commit 40acb05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Expand Up @@ -27,6 +27,7 @@
import java.util.Map.Entry;
import java.util.Properties;
import java.util.SortedSet;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -1539,7 +1540,11 @@ public String getLDAPAdminRole() {
// ============================================================================

public String getTimeZone() {
return getOptional("kylin.web.timezone", "PST");
String timezone = getOptional("kylin.web.timezone");
if (StringUtils.isBlank(timezone)) {
timezone = TimeZone.getDefault().getID();
}
return timezone;
}

public boolean isWebCrossDomainEnabled() {
Expand Down
2 changes: 1 addition & 1 deletion core-common/src/main/resources/kylin-defaults.properties
Expand Up @@ -41,7 +41,7 @@ kylin.server.mode=all
kylin.server.cluster-servers=localhost:7070

# Display timezone on UI,format like[GMT+N or GMT-N]
kylin.web.timezone=GMT+8
kylin.web.timezone=

# Timeout value for the queries submitted through the Web UI, in milliseconds
kylin.web.query-timeout=300000
Expand Down
Expand Up @@ -47,6 +47,7 @@ public void testGetPublicConfig() throws IOException {
String path = Thread.currentThread().getContextClassLoader().getResource("kylin.properties").getPath();

KylinConfig config = KylinConfig.createInstanceFromUri(path);
String timeZone = config.getTimeZone();
try (SetAndUnsetThreadLocalConfig autoUnset = KylinConfig.setAndUnsetThreadLocalConfig(config)) {

String expected = "kylin.web.link-streaming-guide=http://kylin.apache.org/\n" +
Expand All @@ -55,7 +56,7 @@ public void testGetPublicConfig() throws IOException {
"kylin.query.cache-enabled=true\n" +
"kylin.web.link-diagnostic=\n" +
"kylin.web.help.length=4\n" +
"kylin.web.timezone=GMT+8\n" +
"kylin.web.timezone=\n" +
"kylin.server.external-acl-provider=\n" +
"kylin.tool.auto-migrate-cube.enabled=\n" +
"kylin.storage.default=2\n" +
Expand Down

0 comments on commit 40acb05

Please sign in to comment.