[CHORE]: x: T = None to x: Optional[T] = None (#24217)

This commit is contained in:
willzhao
2025-08-21 21:58:39 +08:00
committed by GitHub
parent 106ab7f2a8
commit 5ab6bc283c
14 changed files with 29 additions and 25 deletions

View File

@@ -3,7 +3,7 @@ import logging
import ssl
from collections.abc import Callable
from datetime import timedelta
from typing import TYPE_CHECKING, Any, Union
from typing import TYPE_CHECKING, Any, Optional, Union
import redis
from redis import RedisError
@@ -246,7 +246,7 @@ def init_app(app: DifyApp):
app.extensions["redis"] = redis_client
def redis_fallback(default_return: Any = None):
def redis_fallback(default_return: Optional[Any] = None):
"""
decorator to handle Redis operation exceptions and return a default value when Redis is unavailable.