소스 검색

fix: 捕获InterruptedException后中断线程

zengweijie 3 년 전
부모
커밋
313f030688
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/main/java/com/inspur/smsb/gateway/filter/LicenseFilter.java

+ 2 - 2
src/main/java/com/inspur/smsb/gateway/filter/LicenseFilter.java

@@ -135,9 +135,9 @@ public class LicenseFilter implements GlobalFilter, Ordered, InitializingBean, D
             while (checkSysLocked()) {
                 try {
                     Thread.sleep(Duration.ofMinutes(STEP).toMillis());
-                } catch (InterruptedException e) {// NOSONAR
+                } catch (InterruptedException e) {
                     log.error(e.getMessage(), e);
-                    break;
+                    Thread.currentThread().interrupt();
                 }
             }
             threadPoolTaskExecutor.shutdown();