0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 22:41:12 +01:00

ircd::db: Use our fs::size() for file sizing env callback.

This commit is contained in:
Jason Volk 2018-08-23 04:20:42 -07:00
parent 29d4ec71d5
commit bbcddbcf5b

View file

@ -2106,17 +2106,30 @@ noexcept
} }
rocksdb::Status rocksdb::Status
ircd::db::database::env::GetFileSize(const std::string& name, ircd::db::database::env::GetFileSize(const std::string &name,
uint64_t* s) uint64_t *const s)
noexcept noexcept try
{ {
#ifdef RB_DEBUG_DB_ENV #ifdef RB_DEBUG_DB_ENV
log.debug("'%s': get file size '%s'", log::debug
d.name, {
name); log, "'%s': get file size '%s'",
d.name,
name
};
#endif #endif
return defaults.GetFileSize(name, s); assert(s);
*s = fs::size(name);
return Status::OK();
}
catch(const fs::error &e)
{
return error_to_status{e};
}
catch(const std::exception &e)
{
return error_to_status{e};
} }
rocksdb::Status rocksdb::Status