mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix type hints for redis TTL params (#922)
* Allow to use `int` and `datetime.timedelta` * Fix imports * Added changelog * Update CHANGES
This commit is contained in:
parent
b3b320c106
commit
adfc89f125
2 changed files with 4 additions and 2 deletions
1
CHANGES/922.feature.rst
Normal file
1
CHANGES/922.feature.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed type hints for redis TTL params.
|
||||
|
|
@ -5,6 +5,7 @@ from typing import Any, AsyncGenerator, Dict, Literal, Optional, cast
|
|||
from redis.asyncio.client import Redis
|
||||
from redis.asyncio.connection import ConnectionPool
|
||||
from redis.asyncio.lock import Lock
|
||||
from redis.typing import ExpiryT
|
||||
|
||||
from aiogram import Bot
|
||||
from aiogram.dispatcher.fsm.state import State
|
||||
|
|
@ -90,8 +91,8 @@ class RedisStorage(BaseStorage):
|
|||
self,
|
||||
redis: Redis,
|
||||
key_builder: Optional[KeyBuilder] = None,
|
||||
state_ttl: Optional[int] = None,
|
||||
data_ttl: Optional[int] = None,
|
||||
state_ttl: Optional[ExpiryT] = None,
|
||||
data_ttl: Optional[ExpiryT] = None,
|
||||
lock_kwargs: Optional[Dict[str, Any]] = None,
|
||||
) -> None:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue