Skip to content

Commit

Permalink
GRP-1388: timer issue in psp
Browse files Browse the repository at this point in the history
  • Loading branch information
mchyzer committed Oct 18, 2016
1 parent abde53e commit b83876f
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -470,7 +470,7 @@ public long processChangeLogEntries(final List<ChangeLogEntry> changeLogEntryLis
String lastContextId = null;

LOG.debug("PSP Consumer '{}' - Processing change log entry list size '{}'", name, changeLogEntryList.size());

boolean first = true;
// process each change log entry
for (ChangeLogEntry changeLogEntry : changeLogEntryList) {

Expand All @@ -485,7 +485,8 @@ public long processChangeLogEntries(final List<ChangeLogEntry> changeLogEntryLis
}

// if first run, start the stop watch and store the last sequence number
if (lastContextId == null) {
if (first) {
first = false;
stopWatch.start();
lastContextId = changeLogEntry.getContextId();
}
Expand All @@ -508,7 +509,7 @@ public long processChangeLogEntries(final List<ChangeLogEntry> changeLogEntryLis
}

// if the change log context id has changed, log and restart stop watch
if (!StringUtils.equals(lastContextId, changeLogEntry.getContextId())) {
if (lastContextId == null || changeLogEntry.getContextId() == null || !StringUtils.equals(lastContextId, changeLogEntry.getContextId())) {
stopWatch.stop();
LOG.debug("PSP Consumer '{}' - Processed change log context '{}' Elapsed time {}", new Object[] {name,
lastContextId, stopWatch,});
Expand Down

0 comments on commit b83876f

Please sign in to comment.