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 40
40
import org .springframework .data .redis .connection .RedisSentinelConfiguration ;
41
41
import org .springframework .data .redis .connection .RedisSentinelConnection ;
42
42
import org .springframework .util .Assert ;
43
+ import org .springframework .util .ClassUtils ;
43
44
import org .springframework .util .StringUtils ;
44
45
45
46
import com .lambdaworks .redis .AbstractRedisClient ;
@@ -147,8 +148,18 @@ public void afterPropertiesSet() {
147
148
* @see org.springframework.beans.factory.DisposableBean#destroy()
148
149
*/
149
150
public void destroy () {
151
+
150
152
resetConnection ();
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
+ }
152
163
153
164
if (clusterCommandExecutor != null ) {
154
165
You can’t perform that action at this time.
0 commit comments