Commit 2563e89c authored by wangjinjing's avatar wangjinjing

定时推送

parent 92b3255a
...@@ -83,7 +83,7 @@ public class ScheduleTaskConfig { ...@@ -83,7 +83,7 @@ public class ScheduleTaskConfig {
/*** /***
* 每5分钟执行一次查询车流推送给广达 * 每5分钟执行一次查询车流推送给广达
*/ */
@Scheduled(cron = "0 */5 * * * ?") @Scheduled(fixedDelay = 1000*5)
private void sendToguangdaDevice() { private void sendToguangdaDevice() {
log.info("fiveflow sendto guangda" ); log.info("fiveflow sendto guangda" );
//查询所有未推送的数据 //查询所有未推送的数据
......
...@@ -111,7 +111,7 @@ public class TraffFlowService { ...@@ -111,7 +111,7 @@ public class TraffFlowService {
log.info("fiveflow url" +url); log.info("fiveflow url" +url);
HttpEntity<List<VideoDeviceTraffic>> requestEntity = new HttpEntity<>(list, headers); HttpEntity<List<VideoDeviceTraffic>> requestEntity = new HttpEntity<>(list, headers);
try{ try{
ResultObj obj= CompletableFuture.supplyAsync(() -> restTemplate.postForObject(url, requestEntity, ResultObj.class)).get(timeout,TimeUnit.MILLISECONDS); ResultObj obj=restTemplate.postForObject(url, requestEntity, ResultObj.class);
log.info("send devicelist to guangda result "+obj.getStatus()+obj.getData()+obj.getMsg()); log.info("send devicelist to guangda result "+obj.getStatus()+obj.getData()+obj.getMsg());
}catch (Exception ex){ }catch (Exception ex){
log.error("send devicelist to guangda error:"+ex.toString()); log.error("send devicelist to guangda error:"+ex.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment