标签:ogg factory 自动 缓存数据库 refresh 主线程 etl itext cto
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Order(1)
public class InitExtraResource implements CommandLineRunner {
@Autowired
MetadataDubboService metadataDubboService;
public static final Logger logger = LoggerFactory.getLogger(InitExtraResource.class);
@Override
public void run(String... strings) {
logger.info("缓存数据库信息初始化开始。。。");
metadataDubboService.refreshCache("ALL");//多线程实现,否则阻塞主线程
logger.info("缓存数据库信息初始化成功!");
}
}
标签:ogg factory 自动 缓存数据库 refresh 主线程 etl itext cto
原文地址:https://www.cnblogs.com/jvStarBlog/p/11136167.html