Commit f3b775eb authored by 李洪明's avatar 李洪明

添加登录

parent 02500678
Pipeline #1277 failed with stages
......@@ -2,6 +2,7 @@ package com.bme.access.upload.job;
import com.bme.access.upload.common.HttpUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.springframework.scheduling.annotation.EnableScheduling;
......@@ -14,11 +15,11 @@ import org.springframework.stereotype.Component;
public class HeartBeatJob {
private final static String HEART_BEAT_URL = "https://dctapi.soszyzg.com/dct/heartbeat";
@Scheduled(cron = "0 0/30 * * * ?")
@Scheduled(cron = "0 0/1 * * * ?")
public void heartBeat() {
try {
HttpResponse response = HttpUtils.sendGet(HEART_BEAT_URL, null, null);
String str = EntityUtils.toString(response.getEntity());
HttpUtils.sendGet(HEART_BEAT_URL, null, null);
} catch (Exception e) {
log.error("心跳协议(每半个小时调用一次): {}", e);
}
......
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