内容上下线不变更更新时间的问题
Showing
2 changed files
with
5 additions
and
4 deletions
... | @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; | ... | @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; |
10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
11 | 11 | ||
12 | import java.sql.Connection; | 12 | import java.sql.Connection; |
13 | import java.util.Date; | ||
13 | 14 | ||
14 | @Component | 15 | @Component |
15 | @Slf4j | 16 | @Slf4j |
... | @@ -27,7 +28,7 @@ public class AutoOnlineProcessor { | ... | @@ -27,7 +28,7 @@ public class AutoOnlineProcessor { |
27 | try { | 28 | try { |
28 | connection = dbUtil.getConnection(); | 29 | connection = dbUtil.getConnection(); |
29 | // 查询未绑定 | 30 | // 查询未绑定 |
30 | 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); | 31 | 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); |
31 | dbUtil.doExecute(connection, sql, today); | 32 | dbUtil.doExecute(connection, sql, today); |
32 | // 提交事务 | 33 | // 提交事务 |
33 | dbUtil.commitTransaction(connection); | 34 | dbUtil.commitTransaction(connection); | ... | ... |
... | @@ -15,7 +15,7 @@ cron: | ... | @@ -15,7 +15,7 @@ cron: |
15 | # 任务执行间隔 | 15 | # 任务执行间隔 |
16 | app: 0/10 * * * * ? | 16 | app: 0/10 * * * * ? |
17 | service: 0/10 * * * * ? | 17 | service: 0/10 * * * * ? |
18 | media-online: 0/10 * * * * ? | 18 | media-online: 0/60 * * * * ? |
19 | 19 | ||
20 | spring: | 20 | spring: |
21 | mail: | 21 | mail: |
... | @@ -34,5 +34,5 @@ entity: | ... | @@ -34,5 +34,5 @@ entity: |
34 | appId: 63 | 34 | appId: 63 |
35 | # 自动绑的服务包id | 35 | # 自动绑的服务包id |
36 | serviceId: 1 | 36 | serviceId: 1 |
37 | # 自动上线判断依据:创建更新时间间隔秒 | 37 | # 自动上线判断依据:创建更新时间间隔,与执行时间一致秒 |
38 | difference: 1800 | 38 | difference: 60 | ... | ... |
-
Please register or sign in to post a comment