@@ -172,18 +172,10 @@ void initSaiRedis(const string &record_location)
172
172
* to be performed, and they should be executed before creating switch.
173
173
*/
174
174
175
- /* Disable/enable SAI Redis recording */
176
175
sai_attribute_t attr;
177
- attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
178
- attr.value .booldata = gSairedisRecord ;
176
+ sai_status_t status;
179
177
180
- sai_status_t status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
181
- if (status != SAI_STATUS_SUCCESS)
182
- {
183
- SWSS_LOG_ERROR (" Failed to %s SAI Redis recording, rv:%d" ,
184
- gSairedisRecord ? " enable" : " disable" , status);
185
- exit (EXIT_FAILURE);
186
- }
178
+ /* set recording dir before enable recording */
187
179
188
180
if (gSairedisRecord )
189
181
{
@@ -200,6 +192,19 @@ void initSaiRedis(const string &record_location)
200
192
}
201
193
}
202
194
195
+ /* Disable/enable SAI Redis recording */
196
+
197
+ attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
198
+ attr.value .booldata = gSairedisRecord ;
199
+
200
+ status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
201
+ if (status != SAI_STATUS_SUCCESS)
202
+ {
203
+ SWSS_LOG_ERROR (" Failed to %s SAI Redis recording, rv:%d" ,
204
+ gSairedisRecord ? " enable" : " disable" , status);
205
+ exit (EXIT_FAILURE);
206
+ }
207
+
203
208
attr.id = SAI_REDIS_SWITCH_ATTR_USE_PIPELINE;
204
209
attr.value .booldata = true ;
205
210
0 commit comments