|
@@ -2,7 +2,10 @@ package com.pavis.ai.app.crocr.common.config;
|
|
|
|
|
|
import com.pavis.ai.app.crocr.common.config.properties.CommonProperties;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.web.context.request.async.TimeoutCallableProcessingInterceptor;
|
|
|
+import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
|
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
@@ -20,5 +23,15 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
|
|
|
+ configurer.setDefaultTimeout(600000);
|
|
|
+ configurer.registerCallableInterceptors(timeoutInterceptor());
|
|
|
+ }
|
|
|
+ @Bean
|
|
|
+ public TimeoutCallableProcessingInterceptor timeoutInterceptor() {
|
|
|
+ return new TimeoutCallableProcessingInterceptor();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|