@@ -1207,12 +1207,14 @@ sai_status_t handle_generic(
1207
1207
* To support multiple switches vid/rid map must be per switch.
1208
1208
*/
1209
1209
1210
- std::lock_guard<std::mutex> lock (g_db_mutex);
1210
+ {
1211
+ std::lock_guard<std::mutex> lock (g_db_mutex);
1211
1212
1212
- g_redisClient->hset (VIDTORID, str_vid, str_rid);
1213
- g_redisClient->hset (RIDTOVID, str_rid, str_vid);
1213
+ g_redisClient->hset (VIDTORID, str_vid, str_rid);
1214
+ g_redisClient->hset (RIDTOVID, str_rid, str_vid);
1214
1215
1215
- save_rid_and_vid_to_local (real_object_id, object_id);
1216
+ save_rid_and_vid_to_local (real_object_id, object_id);
1217
+ }
1216
1218
1217
1219
SWSS_LOG_INFO (" saved VID %s to RID %s" , str_vid.c_str (), str_rid.c_str ());
1218
1220
@@ -1243,12 +1245,14 @@ sai_status_t handle_generic(
1243
1245
* TODO: This must be ATOMIC.
1244
1246
*/
1245
1247
1246
- std::lock_guard<std::mutex> lock (g_db_mutex);
1248
+ {
1249
+ std::lock_guard<std::mutex> lock (g_db_mutex);
1247
1250
1248
- g_redisClient->hdel (VIDTORID, str_vid);
1249
- g_redisClient->hdel (RIDTOVID, str_rid);
1251
+ g_redisClient->hdel (VIDTORID, str_vid);
1252
+ g_redisClient->hdel (RIDTOVID, str_rid);
1250
1253
1251
- remove_rid_and_vid_from_local (rid, object_id);
1254
+ remove_rid_and_vid_from_local (rid, object_id);
1255
+ }
1252
1256
1253
1257
if (object_type == SAI_OBJECT_TYPE_SWITCH)
1254
1258
{
0 commit comments