Fix index not updating

This commit is contained in:
Jacob Dufault 2018-01-18 01:33:29 -08:00
parent 545838f7eb
commit ae26aa93db

View File

@ -277,8 +277,7 @@ std::vector<FileContents> PreloadFileContents(
std::vector<FileContents> file_contents = {contents}; std::vector<FileContents> file_contents = {contents};
cache_manager->IterateLoadedCaches([&](IndexFile* index) { cache_manager->IterateLoadedCaches([&](IndexFile* index) {
optional<std::string> index_content = optional<std::string> index_content = ReadContent(index->path);
cache_manager->LoadCachedFileContents(index->path);
if (!index_content) { if (!index_content) {
LOG_S(ERROR) << "Failed to load index content for " << index->path; LOG_S(ERROR) << "Failed to load index content for " << index->path;
return; return;
@ -290,8 +289,7 @@ std::vector<FileContents> PreloadFileContents(
}); });
if (!loaded_primary) { if (!loaded_primary) {
optional<std::string> content = optional<std::string> content = ReadContent(path_to_index);
cache_manager->LoadCachedFileContents(path_to_index);
if (!content) { if (!content) {
// Modification timestamp should have detected this already. // Modification timestamp should have detected this already.
LOG_S(ERROR) << "Skipping index (file cannot be found): " LOG_S(ERROR) << "Skipping index (file cannot be found): "