修改新闻定时发布未每分钟一次
This commit is contained in:
+3
-2
@@ -27,11 +27,12 @@ public class NewsPushJob implements SimpleJob {
|
||||
@Override
|
||||
public void execute(ShardingContext shardingContext) {
|
||||
try {
|
||||
String time = DateUtils.date2Str(new Date(), "yyyy-MM-dd HH");
|
||||
time = time + ":00:00";
|
||||
String time = DateUtils.date2Str(new Date(), "yyyy-MM-dd HH:mm");
|
||||
time = time + ":00";
|
||||
logger.info("开始执行新闻定时发布:"+ time);
|
||||
newsService.pushNews(time);
|
||||
newsService.offlineNews(time);
|
||||
logger.info("结束执行新闻定时发布:"+ time);
|
||||
} catch (Exception e) {
|
||||
logger.error("新闻定时发布和下架任务异常", e);
|
||||
DingDingMessageUtil.sendTextMessage("新闻定时发布和下架任务异常:" + e.getMessage());
|
||||
|
||||
@@ -103,14 +103,12 @@
|
||||
|
||||
</job:simple>
|
||||
|
||||
<!-- 有房小新闻定时发布 每小时执行一次 -->
|
||||
<!-- 有房小新闻定时发布 每分钟执行一次 -->
|
||||
<job:simple id="newsPushJob" class="com.fangjia.job.youfang.job.NewsPushJob" registry-center-ref="regCenter"
|
||||
sharding-total-count="1" cron="0 0 * * * ?" sharding-item-parameters=""
|
||||
failover="true" description="【有房】 有房小新闻定时发布 每小时执行一次"
|
||||
sharding-total-count="1" cron="0/60 * * * * ?" sharding-item-parameters=""
|
||||
failover="true" description="【有房】 有房小新闻定时发布 每分钟执行一次"
|
||||
overwrite="true" event-trace-rdb-data-source="elasticJobLog" job-exception-handler="com.fangjia.job.youfang.handler.CustomJobExceptionHandler">
|
||||
|
||||
<job:listener class="com.fangjia.job.youfang.listener.MessageElasticJobListener"></job:listener>
|
||||
|
||||
</job:simple>
|
||||
|
||||
<!-- 有房小区详情缓存刷新任务
|
||||
|
||||
Reference in New Issue
Block a user