Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 7, 2012
1 parent f38698c commit aee1da6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
Expand Up @@ -129,6 +129,8 @@ public void cleanupTriggers() {
for (String name : names) {
count += platform.getSqlTemplate().update("drop trigger " + name);
}
log.info("Remove {} triggers", count);
if (count > 0) {
log.info("Remove {} triggers", count);
}
}
}
Expand Down
Expand Up @@ -347,7 +347,7 @@ protected void autoConfigChannels() {
List<NodeChannel> channels = getNodeChannels(false);
for (Channel defaultChannel : defaultChannels) {
if (!defaultChannel.isInList(channels)) {
log.info("Auto-configuring {} channel.", defaultChannel.getChannelId());
log.info("Auto-configuring {} channel", defaultChannel.getChannelId());
saveChannel(defaultChannel, true);
} else {
log.debug("No need to create channel {}. It already exists", defaultChannel.getChannelId());
Expand Down
Expand Up @@ -62,7 +62,7 @@ public class ParameterService implements IParameterService {

private Properties systemProperties;

private boolean initialized = false;
private boolean databaseHashBeenInitialized = false;

private String tablePrefix;

Expand Down Expand Up @@ -208,11 +208,10 @@ private TypedProperties rereadDatabaseParameters(Properties p) {
properties.putAll(rereadDatabaseParameters(
p.getProperty(ParameterConstants.EXTERNAL_ID),
p.getProperty(ParameterConstants.NODE_GROUP_ID)));
initialized = true;
databaseHashBeenInitialized = true;
return properties;
} catch (SqlException ex) {
if (initialized) {
log.warn("Could not read database parameters. We will try again later");
if (databaseHashBeenInitialized) {
throw ex;
} else {
return new TypedProperties();
Expand Down Expand Up @@ -241,10 +240,14 @@ private TypedProperties rereadApplicationParameters() {
private TypedProperties getParameters() {
if (parameters == null
|| (cacheTimeoutInMs > 0 && lastTimeParameterWereCached < (System
.currentTimeMillis() - cacheTimeoutInMs))) {
parameters = rereadApplicationParameters();
lastTimeParameterWereCached = System.currentTimeMillis();
cacheTimeoutInMs = getInt(ParameterConstants.PARAMETER_REFRESH_PERIOD_IN_MS);
.currentTimeMillis() - cacheTimeoutInMs))) {
try {
parameters = rereadApplicationParameters();
lastTimeParameterWereCached = System.currentTimeMillis();
cacheTimeoutInMs = getInt(ParameterConstants.PARAMETER_REFRESH_PERIOD_IN_MS);
} catch (SqlException ex) {
log.error("Could not read database parameters. We will try again later");
}
}
return parameters;
}
Expand Down
Expand Up @@ -143,7 +143,7 @@ protected Level setLoggingLevelForTest(Level level) {
}

protected void logTestRunning() {
logger.info("Running " + new Exception().getStackTrace()[1].getMethodName() + ". ");
logger.info("Running " + new Exception().getStackTrace()[1].getMethodName());
}

protected void logTestComplete() {
Expand Down

0 comments on commit aee1da6

Please sign in to comment.