Skip to content

Commit

Permalink
Close storage before compression
Browse files Browse the repository at this point in the history
Signed-off-by: Anas Abou Allaban <[email protected]>
  • Loading branch information
Anas Abou Allaban committed Feb 6, 2020
1 parent 1dfd42b commit d56476f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,16 @@ void SequentialCompressionWriter::compress_last_file()

void SequentialCompressionWriter::split_bagfile()
{
if (compression_options_.compression_mode == rosbag2_compression::CompressionMode::FILE) {
compress_last_file();
}

const auto storage_uri = format_storage_uri(
base_folder_,
metadata_.relative_file_paths.size());

storage_ = storage_factory_->open_read_write(storage_uri, metadata_.storage_identifier);

if (compression_options_.compression_mode == rosbag2_compression::CompressionMode::FILE) {
compress_last_file();
}

if (!storage_) {
// Add a check to make sure reset() does not compress the file again if we couldn't load the
// storage plugin.
Expand Down

0 comments on commit d56476f

Please sign in to comment.