@@ -1034,7 +1034,8 @@ def renamenx(self, src, dst):
10341034 "Rename key ``src`` to ``dst`` if ``dst`` doesn't already exist"
10351035 return self .execute_command ('RENAMENX' , src , dst )
10361036
1037- def restore (self , name , ttl , value , replace = False , absttl = False ):
1037+ def restore (self , name , ttl , value , replace = False , absttl = False ,
1038+ idletime = None , frequency = None ):
10381039 """
10391040 Create a key using the provided serialized value, previously obtained
10401041 using DUMP.
@@ -1045,12 +1046,32 @@ def restore(self, name, ttl, value, replace=False, absttl=False):
10451046 ``absttl`` if True, specified ``ttl`` should represent an absolute Unix
10461047 timestamp in milliseconds in which the key will expire. (Redis 5.0 or
10471048 greater).
1049+
1050+ ``idletime`` Used for eviction, this is the number of seconds the
1051+ key must be idle, prior to execution.
1052+
1053+ ``frequency`` Used for eviction, this is the frequency counter of
1054+ the object stored at the key, prior to execution.
10481055 """
10491056 params = [name , ttl , value ]
10501057 if replace :
10511058 params .append ('REPLACE' )
10521059 if absttl :
10531060 params .append ('ABSTTL' )
1061+ if idletime is not None :
1062+ params .append ('IDLETIME' )
1063+ try :
1064+ params .append (int (idletime ))
1065+ except ValueError :
1066+ raise DataError ("idletimemust be an integer" )
1067+
1068+ if frequency is not None :
1069+ params .append ('FREQ' )
1070+ try :
1071+ params .append (int (frequency ))
1072+ except ValueError :
1073+ raise DataError ("frequency must be an integer" )
1074+
10541075 return self .execute_command ('RESTORE' , * params )
10551076
10561077 def set (self , name , value ,
@@ -3084,6 +3105,7 @@ def _geosearchgeneric(self, command, *args, **kwargs):
30843105 def module_load (self , path , * args ):
30853106 """
30863107 Loads the module from ``path``.
3108+ Passes all ``*args`` to the module, during loading.
30873109 Raises ``ModuleError`` if a module is not found at ``path``.
30883110 """
30893111 pieces = list (args )
0 commit comments