Commit 6e13534c authored by 钱坤's avatar 钱坤

定时任务默认关闭,部署到prod环境准备跑数据

parent 81c0a5be
...@@ -21,6 +21,7 @@ import me.chanjar.weixin.cp.bean.Gender; ...@@ -21,6 +21,7 @@ import me.chanjar.weixin.cp.bean.Gender;
import me.chanjar.weixin.cp.bean.WxCpDepart; import me.chanjar.weixin.cp.bean.WxCpDepart;
import me.chanjar.weixin.cp.bean.WxCpUser; import me.chanjar.weixin.cp.bean.WxCpUser;
import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl; import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -58,12 +59,16 @@ public class OrgSyncByWxcpJob { ...@@ -58,12 +59,16 @@ public class OrgSyncByWxcpJob {
private RoleService roleService; private RoleService roleService;
@Resource @Resource
private OrgSyncService orgSyncService; private OrgSyncService orgSyncService;
@Value("${tanpu.sync.job.skipped:true}")
private boolean jobSkipped;
@Scheduled(cron="0 30 2 * * ?") //每日凌晨2点30执行 @Scheduled(cron="0 30 6 * * ?") //每日凌晨6点30执行
public void execute(){ public void execute(){
log.info("====== 开始执行OrgSyncByWxcpJob ======"); log.info("====== 开始执行OrgSyncByWxcpJob ======");
try { try {
if (!jobSkipped) {
orgSyncByWxcp("Y"); orgSyncByWxcp("Y");
}
} catch (Exception e) { } catch (Exception e) {
log.error("====== 异常结束执行OrgSyncByWxcpJob,错误:{}=======", e.getMessage()); log.error("====== 异常结束执行OrgSyncByWxcpJob,错误:{}=======", e.getMessage());
} }
......
...@@ -4,6 +4,7 @@ apollo: ...@@ -4,6 +4,7 @@ apollo:
enabled: true # 启用apollo配置中心 enabled: true # 启用apollo配置中心
namespaces: application.yml # 监听namespaces namespaces: application.yml # 监听namespaces
cacheDir: ./apollocache/ # 配置中心缓存路径 cacheDir: ./apollocache/ # 配置中心缓存路径
meta: http://apollo.caixiaoquan.com:8080
# apollo appid # apollo appid
app.id: feo-jobs app.id: feo-jobs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment