use of com.searchcode.app.jobs.repository.IndexBaseRepoJob in project searchcode-server by boyter.
the class AdminRouteService method checkIndexStatus.
public String checkIndexStatus(Request request, Response response) {
if (request.queryParams().contains("reponame")) {
String reponame = request.queryParams("reponame");
String reposLocation = Properties.getProperties().getProperty(Values.REPOSITORYLOCATION, Values.DEFAULTREPOSITORYLOCATION);
IndexBaseRepoJob indexBaseRepoJob = new IndexFileRepoJob();
RepoResult repoResult = Singleton.getRepo().getRepoByName(reponame);
String indexStatus = Values.EMPTYSTRING;
if (repoResult != null) {
indexStatus = repoResult.getData().indexStatus;
}
if (indexBaseRepoJob.checkIndexSucess(reposLocation + "/" + reponame) || "success".equals(indexStatus)) {
return "Indexed ✓";
}
if ("indexing".equals(indexStatus)) {
return "Indexing...";
}
}
return Values.EMPTYSTRING;
}
Aggregations