mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	feat: 升级依赖
This commit is contained in:
		@@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstant
 | 
			
		||||
import com.baomidou.lock.LockFailureStrategy;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
 | 
			
		||||
import java.lang.reflect.Method;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 自定义获取锁失败策略,抛出 {@link ServiceException} 异常
 | 
			
		||||
 */
 | 
			
		||||
@@ -12,9 +14,8 @@ import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
public class DefaultLockFailureStrategy implements LockFailureStrategy {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onLockFailure(String key, long acquireTimeout, int acquireCount) {
 | 
			
		||||
        log.debug("[onLockFailure][线程:{} 获取锁失败,key:{} 获取超时时长:{} ms]", Thread.currentThread().getName(), key, acquireTimeout);
 | 
			
		||||
    public void onLockFailure(String key, Method method, Object[] arguments) {
 | 
			
		||||
        log.debug("[onLockFailure][线程:{} 获取锁失败,key:{} 获取失败:{} ]", Thread.currentThread().getName(), key, arguments);
 | 
			
		||||
        throw new ServiceException(GlobalErrorCodeConstants.LOCKED);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user