refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2024-12-22 19:06:33 -06:00
parent 13f6c10e6e
commit 0a70469cd0
2 changed files with 5 additions and 4 deletions

View File

@ -60,6 +60,7 @@ private:
std::size_t ring_begin_{};
std::size_t ring_end_{};
std::size_t ring_pos_{};
std::string source_path_;
stop_type stop_requested_{false};
private:

View File

@ -66,9 +66,9 @@ ring_buffer_open_file::ring_buffer_open_file(std::string buffer_directory,
buffer_directory, utils::get_last_error_code()));
}
fsi_.source_path =
source_path_ =
utils::path::combine(buffer_directory, {utils::create_uuid_string()});
nf_ = utils::file::file::open_or_create_file(fsi_.source_path);
nf_ = utils::file::file::open_or_create_file(source_path_);
if (not *nf_) {
throw std::runtime_error(fmt::format("failed to create buffer file|err|{}",
utils::get_last_error_code()));
@ -87,9 +87,9 @@ ring_buffer_open_file::~ring_buffer_open_file() {
close();
nf_->close();
if (not utils::file::file(fsi_.source_path).remove()) {
if (not utils::file::file(source_path_).remove()) {
utils::error::raise_api_path_error(
function_name, fsi_.api_path, fsi_.source_path,
function_name, fsi_.api_path, source_path_,
utils::get_last_error_code(), "failed to delete file");
}
}