The binary cache is working again

This commit is contained in:
John Wiegley 2009-11-06 02:07:56 -05:00
parent 61f7d1295f
commit 05d0f1a17f
2 changed files with 3 additions and 12 deletions

View file

@ -201,6 +201,7 @@ std::size_t journal_t::read(const path& pathname,
ifstream stream(filename);
std::size_t count = read(stream, filename, master, scope);
if (count > 0)
sources.push_back(fileinfo_t(filename));
return count;
}

View file

@ -75,7 +75,6 @@ session_t::session_t()
std::size_t session_t::read_data(const string& master_account)
{
bool populated_data_files = false;
bool populated_price_db = false;
if (HANDLER(file_).data_files.empty()) {
path file;
@ -101,15 +100,9 @@ std::size_t session_t::read_data(const string& master_account)
price_db_path = resolve_path(HANDLER(price_db_).str());
optional<archive_t> cache;
if (HANDLED(cache_) && master_account.empty()) {
if (HANDLED(cache_) && master_account.empty())
cache = archive_t(HANDLED(cache_).str());
if (price_db_path) {
HANDLER(file_).data_files.push_back(*price_db_path);
populated_price_db = true;
}
}
if (! (cache &&
cache->should_load(HANDLER(file_).data_files) &&
cache->load(journal))) {
@ -118,7 +111,6 @@ std::size_t session_t::read_data(const string& master_account)
if (journal->read(*price_db_path) > 0)
throw_(parse_error, _("Transactions not allowed in price history file"));
}
HANDLER(file_).data_files.remove(*price_db_path);
}
foreach (const path& pathname, HANDLER(file_).data_files) {
@ -153,8 +145,6 @@ std::size_t session_t::read_data(const string& master_account)
if (populated_data_files)
HANDLER(file_).data_files.clear();
else if (populated_price_db)
HANDLER(file_).data_files.remove(*price_db_path);
VERIFY(journal->valid());