@@ -15,7 +15,7 @@ class DequeueTimeout(Exception):
1515@dataclasses .dataclass (slots = True , kw_only = True )
1616class ZSetModel (BaseModel ):
1717 def cleanup (self , connection : ConnectionType , timestamp : Optional [float ] = None ) -> None :
18- """Remove expired jobs from registry."""
18+ """Remove expired jobs from the registry."""
1919 score = timestamp or current_timestamp ()
2020 connection .zremrangebyscore (self ._key , 0 , score )
2121
@@ -45,23 +45,23 @@ def __contains__(self, item: str) -> bool:
4545 return self .connection .zrank (self ._key , item ) is not None
4646
4747 def all (self , start : int = 0 , end : int = - 1 ) -> List [str ]:
48- """Returns list of all job names.
48+ """Returns a list of all job names.
4949
5050 :param start: Start score/timestamp, default to 0.
5151 :param end: End score/timestamp, default to -1 (i.e., no max score).
52- :returns: Returns list of all job names with timestamp from start to end
52+ :returns: Returns a list of all job names with timestamp from start to end
5353 """
5454 self .cleanup (self .connection )
5555 res = [as_str (job_name ) for job_name in self .connection .zrange (self ._key , start , end )]
5656 logger .debug (f"Getting jobs for registry { self ._key } : { len (res )} found." )
5757 return res
5858
5959 def all_with_timestamps (self , start : int = 0 , end : int = - 1 ) -> List [Tuple [str , float ]]:
60- """Returns list of all job names with their timestamps.
60+ """Returns a list of all job names with their timestamps.
6161
6262 :param start: Start score/timestamp, default to 0.
6363 :param end: End score/timestamp, default to -1 (i.e., no max score).
64- :returns: Returns list of all job names with timestamp from start to end
64+ :returns: Returns a list of all job names with timestamp from start to end
6565 """
6666 self .cleanup (self .connection )
6767 res = self .connection .zrange (self ._key , start , end , withscores = True )
0 commit comments