@@ -1153,12 +1153,25 @@ def save(self, **kwargs) -> ResponseT:
11531153 """
11541154 return self .execute_command ("SAVE" , ** kwargs )
11551155
1156- def shutdown (self , save : bool = False , nosave : bool = False , ** kwargs ) -> None :
1156+ def shutdown (
1157+ self ,
1158+ save : bool = False ,
1159+ nosave : bool = False ,
1160+ now : bool = False ,
1161+ force : bool = False ,
1162+ abort : bool = False ,
1163+ ** kwargs ,
1164+ ) -> None :
11571165 """Shutdown the Redis server. If Redis has persistence configured,
1158- data will be flushed before shutdown. If the "save" option is set,
1159- a data flush will be attempted even if there is no persistence
1160- configured. If the "nosave" option is set, no data flush will be
1161- attempted. The "save" and "nosave" options cannot both be set.
1166+ data will be flushed before shutdown.
1167+ It is possible to specify modifiers to alter the behavior of the command:
1168+ ``save`` will force a DB saving operation even if no save points are configured.
1169+ ``nosave`` will prevent a DB saving operation even if one or more save points
1170+ are configured.
1171+ ``now`` skips waiting for lagging replicas, i.e. it bypasses the first step in
1172+ the shutdown sequence.
1173+ ``force`` ignores any errors that would normally prevent the server from exiting
1174+ ``abort`` cancels an ongoing shutdown and cannot be combined with other flags.
11621175
11631176 For more information see https://redis.io/commands/shutdown
11641177 """
@@ -1169,6 +1182,12 @@ def shutdown(self, save: bool = False, nosave: bool = False, **kwargs) -> None:
11691182 args .append ("SAVE" )
11701183 if nosave :
11711184 args .append ("NOSAVE" )
1185+ if now :
1186+ args .append ("NOW" )
1187+ if force :
1188+ args .append ("FORCE" )
1189+ if abort :
1190+ args .append ("ABORT" )
11721191 try :
11731192 self .execute_command (* args , ** kwargs )
11741193 except ConnectionError :
@@ -1279,7 +1298,13 @@ async def memory_help(self, **kwargs) -> None:
12791298 return super ().memory_help (** kwargs )
12801299
12811300 async def shutdown (
1282- self , save : bool = False , nosave : bool = False , ** kwargs
1301+ self ,
1302+ save : bool = False ,
1303+ nosave : bool = False ,
1304+ now : bool = False ,
1305+ force : bool = False ,
1306+ abort : bool = False ,
1307+ ** kwargs ,
12831308 ) -> None :
12841309 """Shutdown the Redis server. If Redis has persistence configured,
12851310 data will be flushed before shutdown. If the "save" option is set,
@@ -1296,6 +1321,12 @@ async def shutdown(
12961321 args .append ("SAVE" )
12971322 if nosave :
12981323 args .append ("NOSAVE" )
1324+ if now :
1325+ args .append ("NOW" )
1326+ if force :
1327+ args .append ("FORCE" )
1328+ if abort :
1329+ args .append ("ABORT" )
12991330 try :
13001331 await self .execute_command (* args , ** kwargs )
13011332 except ConnectionError :
0 commit comments