Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(api): replace Any with precise types in db_migration_lock (#34891)
corevibe555130ad295d05b
diff --git a/api/libs/db_migration_lock.py b/api/libs/db_migration_lock.pyindex 1d3a81e0a20..ca8956e3971 100644--- a/api/libs/db_migration_lock.py+++ b/api/libs/db_migration_lock.py@@ -14,9 +14,15 @@ from __future__ import annotationsimport loggingimport threading-from typing import Any+from typing import TYPE_CHECKING, Any+import redis+from redis.cluster import RedisClusterfrom redis.exceptions import LockNotOwnedError, RedisError+from redis.lock import Lock++if TYPE_CHECKING:+ from extensions.ext_redis import RedisClientWrapperlogger = logging.getLogger(__name__)@@ -38,21 +44,21 @@ class DbMigrationAutoRenewLock:primary error/exit code."""- _redis_client: Any+ _redis_client: redis.Redis | RedisCluster | RedisClientWrapper_name: str_ttl_seconds: float_renew_interval_seconds: float_log_context: str | None_logger: logging.Logger- _lock: Any+ _lock: Lock | None_stop_event: threading.Event | None_thread: threading.Thread | None_acquired: booldef __init__(self,- redis_client: Any,+ redis_client: redis.Redis | RedisCluster | RedisClientWrapper,name: str,ttl_seconds: float = 60,renew_interval_seconds: float | None = None,@@ -127,7 +133,7 @@ class DbMigrationAutoRenewLock:)self._thread.start()- def _heartbeat_loop(self, lock: Any, stop_event: threading.Event) -> None:+ def _heartbeat_loop(self, lock: Lock, stop_event: threading.Event) -> None:while not stop_event.wait(self._renew_interval_seconds):try:lock.reacquire()