Skip to content

Commit

Permalink
[SHIBUI-899]
Browse files Browse the repository at this point in the history
Removed commented code.
  • Loading branch information
Bill Smith committed Sep 25, 2018
1 parent ab4febc commit 7fb13a9
Showing 1 changed file with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,60 +101,29 @@ public void refilter() {
public synchronized void refresh() throws ResolverException {
DateTime now = null;
String mdId = null;
// boolean trackRefreshSuccess = false;

try {
// In case a destroy() thread beat this thread into the monitor.
if (isDestroyed()) {
return;
}

// A manual refresh() must cancel the previously-scheduled future task, since will (re)schedule its own.
// If this execution *is* the task, it's ok to cancel ourself, we're already running.
/*if (refreshMetadataTask != null) {
refreshMetadataTask.cancel();
}*/

now = new DateTime(ISOChronology.getInstanceUTC());
mdId = getMetadataIdentifier();

// log.debug("{} Beginning refresh of metadata from '{}'", getLogPrefix(), mdId);

final byte[] mdBytes = fetchMetadata();
if (mdBytes == null) {
// log.info("{} Metadata from '{}' has not changed since last refresh", getLogPrefix(), mdId);
processCachedMetadata(mdId, now);
} else {
// log.debug("{} Processing new metadata from '{}'", getLogPrefix(), mdId);
processNewMetadata(mdId, now, mdBytes);
}
} catch (final Throwable t) {
// trackRefreshSuccess = false;
// log.error("{} Error occurred while attempting to refresh metadata from '{}'", getLogPrefix(), mdId, t);
// nextRefresh = new DateTime(ISOChronology.getInstanceUTC()).plus(minRefreshDelay);
if (t instanceof Exception) {
throw new ResolverException((Exception) t);
} else {
throw new ResolverException(String.format("Saw an error of type '%s' with message '%s'",
t.getClass().getName(), t.getMessage()));
}
} /*finally {
// logCachedMetadataExpiration(now);
if (trackRefreshSuccess) {
wasLastRefreshSuccess = true;
lastSuccessfulRefresh = now;
} else {
wasLastRefreshSuccess = false;
}
refreshMetadataTask = new RefreshMetadataTask();
final long nextRefreshDelay = nextRefresh.getMillis() - System.currentTimeMillis();
// taskTimer.schedule(refreshMetadataTask, nextRefreshDelay);
log.info("{} Next refresh cycle for metadata provider '{}' will occur on '{}' ('{}' local time)",
new Object[] {getLogPrefix(), mdId, nextRefresh,
nextRefresh.toDateTime(DateTimeZone.getDefault()),});
lastRefresh = now;
}*/
}
}
}

0 comments on commit 7fb13a9

Please sign in to comment.