File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/main/java/org/springframework/data/redis/connection/lettuce Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 4040import org .springframework .data .redis .connection .RedisSentinelConfiguration ;
4141import org .springframework .data .redis .connection .RedisSentinelConnection ;
4242import org .springframework .util .Assert ;
43+ import org .springframework .util .ClassUtils ;
4344import org .springframework .util .StringUtils ;
4445
4546import com .lambdaworks .redis .AbstractRedisClient ;
@@ -147,8 +148,18 @@ public void afterPropertiesSet() {
147148 * @see org.springframework.beans.factory.DisposableBean#destroy()
148149 */
149150public void destroy () {
151+
150152resetConnection ();
151- client .shutdown (shutdownTimeout , shutdownTimeout , TimeUnit .MILLISECONDS );
153+
154+ try {
155+ client .shutdown (shutdownTimeout , shutdownTimeout , TimeUnit .MILLISECONDS );
156+ } catch (Exception e ) {
157+
158+ if (log .isWarnEnabled ()) {
159+ log .warn ((client != null ? ClassUtils .getShortName (client .getClass ()) : "LettuceClient" )
160+ + " did not shut down gracefully." , e );
161+ }
162+ }
152163
153164if (clusterCommandExecutor != null ) {
154165
You can’t perform that action at this time.
0 commit comments