Skip to content

Commit dff6e7a

Browse files
[ISSUE #4263] InterruptedExceptions should never be ignored[ThreadUtils] (#4297)
* Update ThreadUtils.java * Update ThreadUtils.java
1 parent dd40227 commit dff6e7a

File tree

1 file changed

+2
-2
lines changed
  • eventmesh-common/src/main/java/org/apache/eventmesh/common/utils

1 file changed

+2
-2
lines changed

eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/ThreadUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void randomPause(long min, long max, TimeUnit timeUnit) {
3434
long timeout = ThreadLocalRandom.current().nextLong(min, max + 1);
3535
timeUnit.sleep(timeout);
3636
} catch (InterruptedException ignore) {
37-
//ignore
37+
Thread.currentThread().interrupt();
3838
}
3939
}
4040

@@ -51,7 +51,7 @@ public static void sleep(long timeout, TimeUnit timeUnit) {
5151
try {
5252
sleepWithThrowException(timeout, timeUnit);
5353
} catch (InterruptedException ignore) {
54-
//ignore
54+
Thread.currentThread().interrupt();
5555
}
5656
}
5757

0 commit comments

Comments
 (0)