handle DB and TTL for redis KV store

This commit is contained in:
shrinitgoyal 2025-08-19 14:54:10 +05:30
parent 46ff302d87
commit e2d295ae40
2 changed files with 7 additions and 2 deletions

View file

@ -31,10 +31,12 @@ class RedisKVStoreConfig(CommonConfig):
type: Literal[KVStoreType.redis.value] = KVStoreType.redis.value
host: str = "localhost"
port: int = 6379
db: int = 0
ttl: int = None
@property
def url(self) -> str:
return f"redis://{self.host}:{self.port}"
return f"redis://{self.host}:{self.port}/{self.db}"
@classmethod
def pip_packages(cls) -> list[str]: