Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions langgraph/checkpoint/redis/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ async def asetup(self) -> None:
# Detect cluster mode if not explicitly set
await self._detect_cluster_mode()

async def setup(self) -> None: # type: ignore[override]
"""Set up the checkpoint saver asynchronously.

This method creates the necessary indices in Redis and detects cluster mode.
It MUST be called before using the checkpointer.

This async method follows the canonical pattern used by PostgreSQL and SQLite
checkpointers in the LangGraph ecosystem. The type ignore is necessary because
the base class defines a sync setup() method, but async checkpointers require
an async setup() method to properly handle coroutines.

Usage: await checkpointer.setup()
"""
await self.asetup()

async def _detect_cluster_mode(self) -> None:
"""Detect if the Redis client is a cluster client by inspecting its class."""
if self.cluster_mode is not None:
Expand Down