SUPPORT-8507: вынес параметр задержки опроса в настройки

This commit is contained in:
Рауф Латыпов 2024-09-06 23:03:06 +03:00
parent d9470861c1
commit 9d6f9a8ce7
2 changed files with 5 additions and 3 deletions

View file

@ -49,6 +49,8 @@ public class FileUploadService {
private static final Logger logger = LoggerFactory.getLogger(FileUploadService.class);
@Value("${av.rest.address}")
private String avRestAddress;
@Value("${av.first.timeout.milliseconds}")
private Long avFirstTimeoutMilliseconds;
@Value("${file.saving.path}")
private String fileSavingPath;
@Value("${http.file.server.out.address:http://localhost/out}")
@ -213,9 +215,8 @@ public class FileUploadService {
HttpGet get = new HttpGet(reportRequestUri);
// waiting for timeout time before first request
long timeout = 1L;
try {
TimeUnit.SECONDS.sleep(timeout);
TimeUnit.MILLISECONDS.sleep(avFirstTimeoutMilliseconds);
}
catch (InterruptedException e) {
throw new FileUploadException(e);

View file

@ -35,5 +35,6 @@ kafka-out.error.topic.name=${OUT_KAFKA_ERROR_TOPIC_NAME}
kafka-out.success.topic.name=${OUT_KAFKA_SUCCESS_TOPIC_NAME}
#
av.rest.address=${AV_REST_ADDRESS}
file.saving.path=/transfer/
av.first.timeout.milliseconds=${AV_FIRST_TIMEOUT_MILLISECONDS}
file.saving.path=${FILE_SAVING_PATH}
http.file.server.out.address=${HTTP_FILE_SERVER_OUT_ADDRESS}