close RedisConnection in EnableRedisKeyspaceNotificationsInitializer
Issue gh-626
This commit is contained in:
committed by
Rob Winch
parent
6263f6e927
commit
802e0e714b
@@ -20,6 +20,8 @@ import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -234,7 +236,17 @@ public class RedisHttpSessionConfiguration extends SpringHttpSessionConfiguratio
|
||||
return;
|
||||
}
|
||||
RedisConnection connection = this.connectionFactory.getConnection();
|
||||
this.configure.configure(connection);
|
||||
try {
|
||||
this.configure.configure(connection);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
connection.close();
|
||||
}
|
||||
catch (Exception e) {
|
||||
LogFactory.getLog(getClass()).error("Error closing RedisConnection", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user