我是靠谱客的博主 要减肥电话,这篇文章主要介绍spring boot mvc 第一次访问加载慢 解决方案,现在分享给大家,希望可以做个参考。

spring boot mvc 第一次访问加载慢,第二次访问就正常了。

解决方案:

项目加载调用一次,预热。

@Component
@Slf4j
public class PreheatingZoneCommandLineRunner implements CommandLineRunner {
@Autowired
RuleUtilService ruleUtilService;
public void run(String... args) {
try {
long start = System.currentTimeMillis();
HttpClientUtil.doGet("http://127.0.0.1:9003/test/test");
log.info("=======promotionDesc预热完成===========耗时:{}",(System.currentTimeMillis()-start));
}catch (Exception e) {
log.error("预热失败!",e);
}
}
} 

 

转载于:https://my.oschina.net/xiaominmin/blog/3070934

最后

以上就是要减肥电话最近收集整理的关于spring boot mvc 第一次访问加载慢 解决方案的全部内容,更多相关spring内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(111)

评论列表共有 0 条评论

立即
投稿
返回
顶部