java - 为什么 Spring 的 Restarter 典当另一个线程
问题描述
在调试 SpringBoot 应用程序时,我在 org.springframework.boot.devtools.restart.Restarter 中看到了这段代码
private void immediateRestart() {
try {
getLeakSafeThread().callAndWait(() -> {
start(FailureHandler.NONE);
cleanupCaches();
return null;
});
}
catch (Exception ex) {
this.logger.warn("Unable to initialize restarter", ex);
}
SilentExitExceptionHandler.exitCurrentThread();
}
那么,为什么 Spring 会这样做,为什么不在start(FailureHandler.NONE);
当前线程中调用呢?
解决方案
推荐阅读
- css - Reactjs / Material-UI:className 在 ToggleButton 组件上不起作用
- webpack - 由于异步 Object.build 中的 webpack 错误,构建失败
- visual-studio - 使用版本号重命名设置输出
- pyspark - 如何过滤 Databricks Autoloader 流中的文件
- angular - 如何使用 Angular RouterLink 导航到路由器插座?
- python - Pandas DataFrame 和 SQL 未提交
- npm - 如何获取节点模块的深度?
- java - 如何在 Project Reactor 中将 Mono 多播给多个订阅者?
- python - 我正在尝试为“空间”到“~”的 Ascii 值创建一个 Vigenere 密码,
- node.js - 仅连接匹配的元素