mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
feat(api): enhance database migration locking mechanism and configuration
- Introduced a configurable Redis lock TTL for database migrations in DeploymentConfig. - Updated the upgrade_db command to handle lock release errors gracefully. - Added documentation for the new MIGRATION_LOCK_TTL environment variable in the .env.example file and docker-compose.yaml. (cherry picked from commit 4a05fb120622908bc109a3715686706aab3d3b59)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from pydantic import Field
|
||||
from pydantic import Field, PositiveInt
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
@ -32,3 +32,8 @@ class DeploymentConfig(BaseSettings):
|
||||
description="Deployment environment (e.g., 'PRODUCTION', 'DEVELOPMENT'), default to PRODUCTION",
|
||||
default="PRODUCTION",
|
||||
)
|
||||
|
||||
MIGRATION_LOCK_TTL: PositiveInt = Field(
|
||||
description="Redis lock TTL for startup DB migration (seconds). Increase for large/slow databases.",
|
||||
default=3600,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user