1.代客下单 失败添加消息提示

This commit is contained in:
SongZhang 2024-09-05 15:04:23 +08:00
parent b7fc525623
commit 72a3057126
1 changed files with 5 additions and 3 deletions

View File

@ -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);
}
}