Skip to content

Commit

Permalink
ros2GH-7 Don't try to read database name from metadata file when open…
Browse files Browse the repository at this point in the history
…ing with ReadWrite io_flag

- This avoids the logging of a 'failed to read metadata' error when recording a new bag
  • Loading branch information
botteroa-si committed Oct 24, 2018
1 parent 873026b commit d7d35b8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ SqliteStorage::SqliteStorage()
void SqliteStorage::open(
const std::string & uri, rosbag2_storage::storage_interfaces::IOFlag io_flag)
{
auto metadata = load_metadata(uri);
auto metadata = is_read_only(io_flag) ?
load_metadata(uri) :
std::unique_ptr<rosbag2_storage::BagMetadata>();

if (metadata) {
if (metadata->relative_file_paths.empty()) {
Expand Down

0 comments on commit d7d35b8

Please sign in to comment.