MCPcopy
hub / github.com/redis/redis-py / is_expired

Method is_expired

redis/maint_notifications.py:77–85  ·  view source on GitHub ↗

Check if this notification has expired based on its TTL and creation time. Returns: bool: True if the notification has expired, False otherwise

(self)

Source from the content-addressed store, hash-verified

75 self.expire_at = self.creation_time + self.ttl
76
77 def is_expired(self) -> bool:
78 """
79 Check if this notification has expired based on its TTL
80 and creation time.
81
82 Returns:
83 bool: True if the notification has expired, False otherwise
84 """
85 return time.monotonic() > (self.creation_time + self.ttl)
86
87 @abstractmethod
88 def __repr__(self) -> str:

Callers 9

__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45
__repr__Method · 0.45

Calls 1

monotonicMethod · 0.80

Tested by

no test coverage detected