Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
feo-jobs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
feo-jobs
Commits
6e13534c
Commit
6e13534c
authored
Jun 15, 2021
by
钱坤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务默认关闭,部署到prod环境准备跑数据
parent
81c0a5be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
OrgSyncByWxcpJob.java
...main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
+25
-20
application.yml
src/main/resources/application.yml
+1
-0
No files found.
src/main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
View file @
6e13534c
...
...
@@ -21,6 +21,7 @@ import me.chanjar.weixin.cp.bean.Gender;
import
me.chanjar.weixin.cp.bean.WxCpDepart
;
import
me.chanjar.weixin.cp.bean.WxCpUser
;
import
me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
...
...
@@ -58,12 +59,16 @@ public class OrgSyncByWxcpJob {
private
RoleService
roleService
;
@Resource
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
(){
log
.
info
(
"====== 开始执行OrgSyncByWxcpJob ======"
);
try
{
if
(!
jobSkipped
)
{
orgSyncByWxcp
(
"Y"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"====== 异常结束执行OrgSyncByWxcpJob,错误:{}======="
,
e
.
getMessage
());
}
...
...
src/main/resources/application.yml
View file @
6e13534c
...
...
@@ -4,6 +4,7 @@ apollo:
enabled
:
true
# 启用apollo配置中心
namespaces
:
application.yml
# 监听namespaces
cacheDir
:
./apollocache/
# 配置中心缓存路径
meta
:
http://apollo.caixiaoquan.com:8080
# apollo appid
app.id
:
feo-jobs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment