mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-19 21:45:06 +08:00
增加菜单的定时刷新
This commit is contained in:
@ -23,6 +23,6 @@ public interface ConfigFrameworkDAO {
|
||||
*
|
||||
* @return 配置列表
|
||||
*/
|
||||
List<InfConfigDO> getSysConfigList();
|
||||
List<InfConfigDO> selectList();
|
||||
|
||||
}
|
||||
|
@ -73,7 +73,6 @@ public class DBConfigRepository extends AbstractConfigRepository {
|
||||
if (CollUtil.isEmpty(configs)) { // 如果没有更新,则返回
|
||||
return;
|
||||
}
|
||||
log.info("[sync][同步到新配置,配置数量为:{}]", configs.size());
|
||||
|
||||
// 第二步,构建新的 Properties
|
||||
Properties newProperties = this.buildProperties(configs);
|
||||
@ -83,6 +82,7 @@ public class DBConfigRepository extends AbstractConfigRepository {
|
||||
this.maxUpdateTime = configs.stream().max(Comparator.comparing(BaseDO::getUpdateTime)).get().getUpdateTime();
|
||||
// 第四部,触发配置刷新!重要!!!!
|
||||
super.fireRepositoryChange(m_namespace, newProperties);
|
||||
log.info("[sync][缓存配置,数量为:{}]", configs.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -150,7 +150,7 @@ public class DBConfigRepository extends AbstractConfigRepository {
|
||||
log.info("[loadConfigIfUpdate][增量加载全量配置]");
|
||||
}
|
||||
// 第二步,如果有更新,则从数据库加载所有配置
|
||||
return configFrameworkDAO.getSysConfigList();
|
||||
return configFrameworkDAO.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.dashboard.framework.quartz.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling // 开启 Spring 自带的定时任务
|
||||
public class QuartzConfig {
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* 定时任务,采用 Quartz 实现进程内的任务执行。
|
||||
* 考虑到高可用,使用 Quartz 自带的 MySQL 集群方案。
|
||||
*/
|
||||
package cn.iocoder.dashboard.framework.quartz;
|
Reference in New Issue
Block a user