[hotfix] 修复因生命周期,getCadThread = 0导致线程池创建失败问题

pull/206/head
lujiaming 1 year ago
parent fa2a5d3e35
commit 4a0409953a

@ -25,6 +25,7 @@ import org.apache.pdfbox.tools.imageio.ImageIOUtil;
import org.apache.poi.EncryptedDocumentException; import org.apache.poi.EncryptedDocumentException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -48,7 +49,7 @@ import java.util.stream.IntStream;
* @date 2017/11/13 * @date 2017/11/13
*/ */
@Component @Component
public class FileHandlerService { public class FileHandlerService implements InitializingBean {
private static final String PDF2JPG_IMAGE_FORMAT = ".jpg"; private static final String PDF2JPG_IMAGE_FORMAT = ".jpg";
private static final String PDF_PASSWORD_MSG = "password"; private static final String PDF_PASSWORD_MSG = "password";
@ -148,7 +149,11 @@ public class FileHandlerService {
/** /**
cad线 cad线
*/ */
private static final ExecutorService pool = Executors.newFixedThreadPool(ConfigConstants.getCadThread()); private ExecutorService pool = null;
@Override
public void afterPropertiesSet() throws Exception {
pool = Executors.newFixedThreadPool(ConfigConstants.getCadThread());
}
/** /**
* () * ()
* *

Loading…
Cancel
Save