Migrate more code into the chrono type system:

Changes include:

  *  Database::tune and all tune overrides
  *  TaggedCache TargetAge
  *  KeyCache TargetAge
This commit is contained in:
Howard Hinnant
2018-06-25 12:27:59 -04:00
committed by Nik Bougalis
parent 574ea2c14d
commit d257d1b2c9
24 changed files with 76 additions and 73 deletions

View File

@@ -28,7 +28,7 @@ namespace ripple {
namespace NodeStore {
Shard::Shard(DatabaseShard const& db, std::uint32_t index,
int cacheSz, PCache::clock_type::rep cacheAge, beast::Journal& j)
int cacheSz, std::chrono::seconds cacheAge, beast::Journal& j)
: index_(index)
, firstSeq_(db.firstLedgerSeq(index))
, lastSeq_(std::max(firstSeq_, db.lastLedgerSeq(index)))
@@ -228,8 +228,8 @@ Shard::validate(Application& app)
"-" << lastSeq_;
// Use a short age to keep memory consumption low
PCache::clock_type::rep const savedAge {pCache_->getTargetAge()};
pCache_->setTargetAge(1);
auto const savedAge {pCache_->getTargetAge()};
pCache_->setTargetAge(1s);
// Validate every ledger stored in this shard
std::shared_ptr<Ledger const> next;