mirror of https://gitee.com/stylefeng/roses
【7.0.3】增加数据源连接自我检测
parent
dfb9e777ed
commit
5cda1ad030
|
@ -74,9 +74,14 @@ public class DataSourceStatusCheckTimer implements TimerAction {
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
// 如果有错误信息,将错误信息存储到表中
|
// 如果有错误信息,将错误信息存储到表中
|
||||||
String errorMessage = exception.getMessage();
|
String errorMessage = exception.getMessage();
|
||||||
|
|
||||||
|
// 如果当前非错误状态则更新状态
|
||||||
|
if (!DataSourceStatusEnum.ERROR.getCode().equals(databaseInfo.getStatusFlag())) {
|
||||||
databaseInfo.setStatusFlag(DataSourceStatusEnum.ERROR.getCode());
|
databaseInfo.setStatusFlag(DataSourceStatusEnum.ERROR.getCode());
|
||||||
databaseInfo.setErrorDescription(errorMessage);
|
databaseInfo.setErrorDescription(errorMessage);
|
||||||
databaseInfoService.updateById(databaseInfo);
|
databaseInfoService.updateById(databaseInfo);
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue