Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
王红岩
/
cms-scheduler
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
160db00a
...
160db00a330fc54681ccaf91cac40b55cf8c2192
authored
2020-12-06 10:24:09 +0800
by
lWoHvYe
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
内容上下线不变更更新时间的问题
1 parent
6e04f592
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
src/main/java/com/topdraw/platform/executor/AutoOnlineProcessor.java
src/main/resources/config/application.yml
src/main/java/com/topdraw/platform/executor/AutoOnlineProcessor.java
View file @
160db00
...
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Transactional
;
import
java.sql.Connection
;
import
java.util.Date
;
@Component
@Slf4j
...
...
@@ -27,7 +28,7 @@ public class AutoOnlineProcessor {
try
{
connection
=
dbUtil
.
getConnection
();
// 查询未绑定
String
sql
=
StrUtil
.
format
(
" update `x_media` set `status` = '001'
where `status` = '000' and file_status = '001' and (update_time - create_time) < {} and create_time >= ? "
,
DIFFERENCE
);
String
sql
=
StrUtil
.
format
(
" update `x_media` set `status` = '001'
,`update_time` = '{}' where `status` = '000' and file_status = '001' and (update_time - create_time) < {} and create_time >= ? "
,
DateUtil
.
now
()
,
DIFFERENCE
);
dbUtil
.
doExecute
(
connection
,
sql
,
today
);
// 提交事务
dbUtil
.
commitTransaction
(
connection
);
...
...
src/main/resources/config/application.yml
View file @
160db00
...
...
@@ -15,7 +15,7 @@ cron:
# 任务执行间隔
app
:
0/10 * * * * ?
service
:
0/10 * * * * ?
media-online
:
0/
1
0 * * * * ?
media-online
:
0/
6
0 * * * * ?
spring
:
mail
:
...
...
@@ -34,5 +34,5 @@ entity:
appId
:
63
# 自动绑的服务包id
serviceId
:
1
# 自动上线判断依据:创建更新时间间隔秒
difference
:
180
0
# 自动上线判断依据:创建更新时间间隔
,与执行时间一致
秒
difference
:
6
0
...
...
Please
register
or
sign in
to post a comment