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:
parent
29d4ec71d5
commit
bbcddbcf5b
1 changed files with 20 additions and 7 deletions
27
ircd/db.cc
27
ircd/db.cc
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue