ES操作失败由报错改为日志打印
This commit is contained in:
parent
49d93543c1
commit
52ea04512d
@ -11,6 +11,7 @@ import com.qiwenshare.file.domain.UserFile;
|
||||
import com.qiwenshare.file.mapper.UserFileMapper;
|
||||
import com.qiwenshare.file.vo.file.FileListVo;
|
||||
import com.qiwenshare.ufo.util.PathUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -23,6 +24,7 @@ import java.util.concurrent.Executors;
|
||||
/**
|
||||
* 文件逻辑处理组件
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class FileDealComp {
|
||||
@Resource
|
||||
@ -221,7 +223,7 @@ public class FileDealComp {
|
||||
|
||||
|
||||
public void uploadESByUserFileId(Long userFileId) {
|
||||
|
||||
try {
|
||||
UserFile userFile = new UserFile();
|
||||
userFile.setUserFileId(userFileId);
|
||||
List<FileListVo> userfileResult = userFileMapper.userFileList(userFile, null, null);
|
||||
@ -230,11 +232,18 @@ public class FileDealComp {
|
||||
BeanUtil.copyProperties(userfileResult.get(0), fileSearch);
|
||||
elasticSearchService.save(fileSearch);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("ES更新操作失败,请检查配置");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void deleteESByUserFileId(Long userFileId) {
|
||||
try {
|
||||
elasticSearchService.deleteById(userFileId);
|
||||
} catch (Exception e) {
|
||||
log.error("ES删除操作失败,请检查配置");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user