Skip to content

Commit a4e20ac

Browse files
committed
def cleanup in base class
1 parent 1d29914 commit a4e20ac

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

redis/asyncio/connection.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,12 +1057,15 @@ class ConnectionPool:
10571057
``connection_class``.
10581058
"""
10591059

1060-
@abstractmethod
10611060
def cleanup(self, **options):
10621061
"""
10631062
Additional cleanup operations that the connection pool might
1064-
need to do after a SCAN ITER family command is executed
1063+
need to do after a SCAN ITER family command is executed.
1064+
1065+
See SentinelManagedConnection for an example cleanup operation that
1066+
might need to be done.
10651067
"""
1068+
pass
10661069

10671070
@classmethod
10681071
def from_url(cls: Type[_CP], url: str, **kwargs) -> _CP:

redis/connection.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,16 @@ def __repr__(self) -> (str, str):
11621162
f"({repr(self.connection_class(**self.connection_kwargs))})>"
11631163
)
11641164

1165+
def cleanup(self, **options):
1166+
"""
1167+
Additional cleanup operations that the connection pool might
1168+
need to do after a SCAN ITER family command is executed.
1169+
1170+
See SentinelManagedConnection for an example cleanup operation that
1171+
might need to be done.
1172+
"""
1173+
pass
1174+
11651175
def reset(self) -> None:
11661176
self._lock = threading.Lock()
11671177
self._created_connections = 0

0 commit comments

Comments
 (0)