feat: Update GitRepositoryIngestor to use ingestion repository base path from application.properties
This commit is contained in:
@@ -22,6 +22,7 @@ import org.springframework.ai.document.Document;
|
|||||||
import org.springframework.ai.transformer.splitter.TokenTextSplitter;
|
import org.springframework.ai.transformer.splitter.TokenTextSplitter;
|
||||||
import org.springframework.ai.vectorstore.VectorStore;
|
import org.springframework.ai.vectorstore.VectorStore;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -33,6 +34,9 @@ import com.olympus.apollo.repository.KSGitInfoRepository;
|
|||||||
@Service
|
@Service
|
||||||
public class GitRepositoryIngestor {
|
public class GitRepositoryIngestor {
|
||||||
|
|
||||||
|
@Value("${ingestion.repository.basepath}")
|
||||||
|
private String ingestionRepositoryBasePath;
|
||||||
|
|
||||||
private final VectorStore vectorStore;
|
private final VectorStore vectorStore;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -46,7 +50,7 @@ public class GitRepositoryIngestor {
|
|||||||
|
|
||||||
@Async
|
@Async
|
||||||
public CompletableFuture<Void> ingestGitRepository(String repo) {
|
public CompletableFuture<Void> ingestGitRepository(String repo) {
|
||||||
String repoPath = "C:\\Users\\vinayak.c.mishra\\dev\\olympus\\upload-dir\\" + repo + "\\";
|
String repoPath = ingestionRepositoryBasePath+"\\" + repo + "\\";
|
||||||
logger.info("Repository path : " + repoPath);
|
logger.info("Repository path : " + repoPath);
|
||||||
|
|
||||||
Optional<KSGitInfo> optionalDocument = ksGitInfoRepository.findByRepoName(repo);
|
Optional<KSGitInfo> optionalDocument = ksGitInfoRepository.findByRepoName(repo);
|
||||||
|
|||||||
@@ -27,3 +27,7 @@ spring.ai.openai.api-key=sk-proj-j3TFJ0h348DIzMrYYfyUT3BlbkFJjk4HMc8A2ux2Asg8Y7H
|
|||||||
spring.servlet.multipart.max-file-size=5000000MB
|
spring.servlet.multipart.max-file-size=5000000MB
|
||||||
spring.servlet.multipart.max-request-size=500000MB
|
spring.servlet.multipart.max-request-size=500000MB
|
||||||
|
|
||||||
|
#path to the repository
|
||||||
|
ingestion.repository.basepath=C:\\Users\\andrea.terzani\\dev\\Olympus
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user