fix(ES连接报错修复): 修复ES未连接时启动报错问题
This commit is contained in:
parent
f4ed0aa5a5
commit
477f336b69
@ -1,8 +1,10 @@
|
||||
package com.qiwenshare.file.api;
|
||||
|
||||
import com.qiwenshare.file.config.es.FileSearch;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
|
||||
@Lazy
|
||||
public interface IElasticSearchService extends ElasticsearchRepository<FileSearch,Long> {
|
||||
|
||||
}
|
@ -14,6 +14,8 @@ import com.qiwenshare.ufop.factory.UFOPFactory;
|
||||
import com.qiwenshare.ufop.util.UFOPUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -42,10 +44,9 @@ public class FileDealComp {
|
||||
IShareFileService shareFileService;
|
||||
@Resource
|
||||
IUserFileService userFileService;
|
||||
@Resource
|
||||
UFOPFactory ufopFactory;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IElasticSearchService elasticSearchService;
|
||||
|
||||
public static Executor exec = Executors.newFixedThreadPool(10);
|
||||
|
@ -6,6 +6,7 @@ import com.qiwenshare.file.domain.UserFile;
|
||||
import com.qiwenshare.file.service.UserFileService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
@ -19,6 +20,7 @@ public class TaskController {
|
||||
@Resource
|
||||
UserFileService userFileService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IElasticSearchService elasticSearchService;
|
||||
@Resource
|
||||
FileDealComp fileDealComp;
|
||||
|
@ -1,5 +1,8 @@
|
||||
server.port=8080
|
||||
|
||||
#环境切换 dev/prod
|
||||
spring.profiles.active=dev
|
||||
|
||||
eureka.client.register-with-eureka=false
|
||||
eureka.client.fetchRegistry=false
|
||||
#eureka.client.server.waitTimeInMsWhenSyncEmpty=0
|
||||
@ -127,6 +130,6 @@ jwt.payload.registerd-claims.aud = qiwenshare
|
||||
qiwen.file.version=1.1.2
|
||||
|
||||
# 当前部署外网IP,用于office预览
|
||||
deployment.host=192.168.31.158
|
||||
deployment.host=192.168.1.6
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user