Skip to content

Commit

Permalink
Move validator inside broadcast client logic
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Oct 2, 2024
1 parent 41d1034 commit 1350d54
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1296,18 +1296,17 @@ void FleetUpdateHandle::Implementation::update_fleet_state() const

try
{
static const auto validator =
make_validator(rmf_api_msgs::schemas::fleet_state_update);

validator.validate(fleet_state_update_msg);

std::unique_lock<std::mutex> lock(*update_callback_mutex);
if (update_callback)
update_callback(fleet_state_update_msg);

// Publish to API server
if (broadcast_client)
{
static const auto validator =
make_validator(rmf_api_msgs::schemas::fleet_state_update);
validator.validate(fleet_state_update_msg);

broadcast_client->publish(fleet_state_update_msg);
}

Expand Down

0 comments on commit 1350d54

Please sign in to comment.