From 72a305712665ee8225e1afb92189b5cc4eae00c7 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Thu, 5 Sep 2024 15:04:23 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=20?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/ysk/cashier/utils/Utils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/utils/Utils.java b/eladmin-system/src/main/java/cn/ysk/cashier/utils/Utils.java index 3c67b37b..1e4897ad 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/utils/Utils.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/utils/Utils.java @@ -60,10 +60,12 @@ public class Utils { lock = Boolean.TRUE.equals(redisTemplate.opsForValue().setIfAbsent(lockKey, clientId, 30, TimeUnit.MILLISECONDS)); } return supplier.get(); - } catch (Exception e){ + } catch (RuntimeException e){ log.info("执行出错:{}", e.getMessage()); - throw new BadRequestException(e.getMessage()); - }finally{ + throw e; + } catch (InterruptedException e) { + throw new RuntimeException(e); + } finally{ redisTemplate.delete(lockKey); } }