Skip to content

Commit

Permalink
Use brackets for each if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
fhanik committed Mar 5, 2018
1 parent 731970c commit 60052ea
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,16 @@ protected void performExpirationClean() {
//check if we should expire again
if ((System.currentTimeMillis()-last) > getExpirationTime()) {
//avoid concurrent deletes from the same UAA - performance improvement
if (lastClean.compareAndSet(last, last+getExpirationTime())) try {
JdbcTemplate template = new JdbcTemplate(dataSource);
int expired = template.update(SQL_EXPIRE_STATEMENT, System.currentTimeMillis());
logger.debug("[oauth_code] Removed "+expired+" expired entries.");
expired = template.update(SQL_CLEAN_STATEMENT, new Timestamp(System.currentTimeMillis()-LEGACY_CODE_EXPIRATION_TIME));
logger.debug("[oauth_code] Removed "+expired+" old entries.");
} catch (DeadlockLoserDataAccessException e) {
logger.debug("[oauth code] Deadlock trying to expire entries, ignored.");
if (lastClean.compareAndSet(last, last+getExpirationTime())) {
try {
JdbcTemplate template = new JdbcTemplate(dataSource);
int expired = template.update(SQL_EXPIRE_STATEMENT, System.currentTimeMillis());
logger.debug("[oauth_code] Removed "+expired+" expired entries.");
expired = template.update(SQL_CLEAN_STATEMENT, new Timestamp(System.currentTimeMillis()-LEGACY_CODE_EXPIRATION_TIME));
logger.debug("[oauth_code] Removed "+expired+" old entries.");
} catch (DeadlockLoserDataAccessException e) {
logger.debug("[oauth code] Deadlock trying to expire entries, ignored.");
}
}
}

Expand Down

0 comments on commit 60052ea

Please sign in to comment.