Commit df9b8c8a authored by zhiguo.liu's avatar zhiguo.liu

fix: 去掉 @ConditionalOnxxx 注解,防止因扫描顺序导致的无法实例化 bean 的问题

parent d22a252b
...@@ -6,9 +6,7 @@ import com.google.common.cache.LoadingCache; ...@@ -6,9 +6,7 @@ import com.google.common.cache.LoadingCache;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -33,8 +31,6 @@ import java.util.concurrent.locks.ReentrantLock; ...@@ -33,8 +31,6 @@ import java.util.concurrent.locks.ReentrantLock;
*/ */
@Slf4j @Slf4j
@Component @Component
@ConditionalOnBean(RedisTemplate.class)
@ConditionalOnProperty(name = "data.center.id")
public class IDGenerator { public class IDGenerator {
private static final String REDIS_WORK_ID_KEY = "GLOBAL:WORK:ID:"; private static final String REDIS_WORK_ID_KEY = "GLOBAL:WORK:ID:";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment