Skip to content

Commit f0c7371

Browse files
author
Vladimir Kotal
committed
ensureHistoryCacheExists() be gone
1 parent 3ebb073 commit f0c7371

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryGuru.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -728,33 +728,6 @@ private List<Repository> getReposFromString(Collection<String> repositories) {
728728
return repos;
729729
}
730730

731-
/**
732-
* Ensure that we have a directory in the cache. If it's not there, fetch
733-
* its history and populate the cache.
734-
*
735-
* @param file the root path to test
736-
* @throws HistoryException if an error occurs while accessing the history
737-
* cache
738-
*/
739-
public void ensureHistoryCacheExists(File file) throws HistoryException {
740-
if (!useCache()) {
741-
return;
742-
}
743-
744-
Repository repository = getRepository(file);
745-
if (repository == null) {
746-
// no repository -> no history
747-
return;
748-
}
749-
750-
if (!repository.hasHistoryForDirectories() ||
751-
historyCache.hasCacheForDirectory(file, repository)) {
752-
return;
753-
}
754-
755-
createCache(repository, null);
756-
}
757-
758731
protected Repository getRepository(File path) {
759732
File file = path;
760733
Set<String> rootKeys = repositoryRoots.keySet();

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
import org.opengrok.indexer.configuration.PathAccepter;
9292
import org.opengrok.indexer.configuration.Project;
9393
import org.opengrok.indexer.configuration.RuntimeEnvironment;
94-
import org.opengrok.indexer.history.HistoryException;
9594
import org.opengrok.indexer.history.HistoryGuru;
9695
import org.opengrok.indexer.history.Repository;
9796
import org.opengrok.indexer.logger.LoggerFactory;
@@ -427,19 +426,6 @@ public void update() throws IOException {
427426
sourceRoot = new File(env.getSourceRootFile(), dir);
428427
}
429428

430-
if (env.isHistoryEnabled()) {
431-
try {
432-
HistoryGuru.getInstance().ensureHistoryCacheExists(
433-
sourceRoot);
434-
} catch (HistoryException ex) {
435-
String exmsg = String.format(
436-
"Failed to ensureHistoryCacheExists() for %s",
437-
sourceRoot);
438-
LOGGER.log(Level.SEVERE, exmsg, ex);
439-
continue;
440-
}
441-
}
442-
443429
dir = Util.fixPathIfWindows(dir);
444430

445431
String startuid = Util.path2uid(dir, "");

0 commit comments

Comments
 (0)