sync update from LAN repo (source dhk-1 @ 3b1ec5b4)
This commit is contained in:
1 parent
da6521b6cb
commit
264e2200d6
995 files changed
+148105
-13399
No files matched your search
+5
-9
@@ -9,14 +9,13 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
from logging.config import fileConfig
|
||||
|
||||
from alembic import context
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from deerflow.persistence.base import Base
|
||||
from deerflow.persistence.migration_utils import configure_mysql_migration_lock_waits
|
||||
|
||||
# Import all models so metadata is populated.
|
||||
try:
|
||||
@@ -54,13 +53,10 @@ def do_run_migrations(connection):
|
||||
# = 1 year; innodb_lock_wait_timeout = 50s). Without this, an idle
|
||||
# transaction on another connection can freeze startup indefinitely.
|
||||
# Tunable via DEER_FLOW_ALEMBIC_LOCK_WAIT (seconds, default 15).
|
||||
if connection.dialect.name == "mysql":
|
||||
try:
|
||||
lock_wait = int(os.getenv("DEER_FLOW_ALEMBIC_LOCK_WAIT", "15"))
|
||||
except ValueError:
|
||||
lock_wait = 15
|
||||
connection.execute(text(f"SET SESSION lock_wait_timeout = {lock_wait}"))
|
||||
connection.execute(text(f"SET SESSION innodb_lock_wait_timeout = {lock_wait}"))
|
||||
from deerflow.persistence.gauss_mysql_compat import is_gauss_mysql_product
|
||||
|
||||
if connection.dialect.name == "mysql" and not is_gauss_mysql_product():
|
||||
configure_mysql_migration_lock_waits(connection)
|
||||
|
||||
context.configure(
|
||||
connection=connection,
|
||||
|
||||
Reference in new issue
Block a user