Skip to content

Commit

Permalink
Merge pull request #2366 from jsonwan/github_perf/file-worker
Browse files Browse the repository at this point in the history
perf: file-worker心跳超时后支持自动恢复 #2365
  • Loading branch information
jsonwan authored Aug 23, 2023
2 parents 8df2920 + 5700bfe commit 92e6f1b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Response<Long> heartBeat(HeartBeatReq heartBeatReq) {

@Override
public Response<String> updateFileSourceTask(UpdateFileSourceTaskReq updateFileSourceTaskReq) {
log.debug("Input=({})", updateFileSourceTaskReq);
log.info("updateFileSourceTaskReq=({})", updateFileSourceTaskReq);
String taskId = updateFileSourceTaskReq.getFileSourceTaskId();
String filePath = updateFileSourceTaskReq.getFilePath();
String downloadPath = updateFileSourceTaskReq.getDownloadPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
RestTemplate restTemplate = new RestTemplate();
OkHttp3ClientHttpRequestFactory requestFactory = new OkHttp3ClientHttpRequestFactory();
requestFactory.setConnectTimeout(5000);
requestFactory.setReadTimeout(15000);
requestFactory.setWriteTimeout(15000);
restTemplate.setRequestFactory(requestFactory);
return restTemplate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
RestTemplate restTemplate = new RestTemplate();
OkHttp3ClientHttpRequestFactory requestFactory = new OkHttp3ClientHttpRequestFactory();
requestFactory.setConnectTimeout(5000);
requestFactory.setReadTimeout(15000);
requestFactory.setWriteTimeout(15000);
restTemplate.setRequestFactory(requestFactory);
return restTemplate;
}
}

0 comments on commit 92e6f1b

Please sign in to comment.