任务时间修改
This commit is contained in:
+3
-9
@@ -57,11 +57,10 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
|
||||
@Override
|
||||
public void execute(ShardingContext shardingContext) {
|
||||
System.out.println("start :"+new Date());
|
||||
logger.info("开始进行小区数据汇总任务");
|
||||
final FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, openApiUrl);
|
||||
//params.put("type", 4);
|
||||
DBCollection collection = seaweedMongoTemplate.getCollection("seaweed");
|
||||
DBCursor cursor = collection.find(new BasicDBObject("cat", "district").append("status", 0).append("city", "上海"),
|
||||
DBCursor cursor = collection.find(new BasicDBObject("cat", "district").append("status", 0),
|
||||
new BasicDBObject("city", 1).append("region", 1).append("name", 1)).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
|
||||
final Semaphore semaphore = new Semaphore(5);
|
||||
while (cursor.hasNext()) {
|
||||
@@ -75,7 +74,6 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
System.out.println("counting...");
|
||||
String city = String.valueOf(data.get("city"));
|
||||
String region = String.valueOf(data.get("region"));
|
||||
String name = String.valueOf(data.get("name"));
|
||||
@@ -140,12 +138,8 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// if(count>=10) {
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
System.out.println("end :"+new Date());
|
||||
logger.info("结束小区数据汇总任务");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,9 +93,9 @@
|
||||
|
||||
</job:simple>
|
||||
|
||||
<!-- 有房小区详情信息汇总 -->
|
||||
<!-- 有房小区详情信息汇总 每周一0点10分执行-->
|
||||
<job:simple id="districtInfoJob" class="com.fangjia.job.youfang.job.DistrictInfoJob" registry-center-ref="regCenter"
|
||||
sharding-total-count="1" cron="30 09 17 * * ?" sharding-item-parameters=""
|
||||
sharding-total-count="1" cron="0 10 0 ? * 2" sharding-item-parameters=""
|
||||
failover="true" description="【有房】 有房小区详情信息汇总"
|
||||
overwrite="true" event-trace-rdb-data-source="elasticJobLog" job-exception-handler="com.fangjia.job.youfang.handler.CustomJobExceptionHandler">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user