Skip to content

Commit 4601ade

Browse files
[MultiDB] use sonic-db-cli instead of redis-cli in new added codes (sonic-net#907)
1 parent 8bfa3b7 commit 4601ade

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/fast-reboot

+4-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function clear_fast_boot()
107107
{
108108
common_clear
109109

110-
redis-cli -n 6 DEL "FAST_REBOOT|system" &>/dev/null || /bin/true
110+
sonic-db-cli STATE_DB DEL "FAST_REBOOT|system" &>/dev/null || /bin/true
111111
}
112112

113113
function clear_warm_boot()
@@ -208,7 +208,8 @@ function backup_database()
208208
end
209209
end
210210
" 0 > /dev/null
211-
redis-cli save > /dev/null
211+
sonic-db-cli SAVE > /dev/null
212+
#TODO : need a script to copy all rdb files if there is multiple db instances config
212213
docker cp database:/var/lib/redis/$REDIS_FILE $WARM_DIR
213214
docker exec -i database rm /var/lib/redis/$REDIS_FILE
214215
}
@@ -317,7 +318,7 @@ case "$REBOOT_TYPE" in
317318
"fast-reboot")
318319
BOOT_TYPE_ARG=$REBOOT_TYPE
319320
trap clear_fast_boot EXIT HUP INT QUIT TERM KILL ABRT ALRM
320-
redis-cli -n 6 SET "FAST_REBOOT|system" "1" "EX" "180" &>/dev/null
321+
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180" &>/dev/null
321322
;;
322323
"warm-reboot")
323324
if [[ "$sonic_asic_type" == "mellanox" ]]; then

0 commit comments

Comments
 (0)