From 3956819c78085fd8c569dee18168573a3d17ea13 Mon Sep 17 00:00:00 2001 From: shaw Date: Mon, 5 Jan 2026 22:24:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E5=A2=9E=E5=8A=A0=E5=88=B010=E5=88=86?= =?UTF-8?q?=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/repository/ent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/repository/ent.go b/backend/internal/repository/ent.go index 9df74a83..8005f114 100644 --- a/backend/internal/repository/ent.go +++ b/backend/internal/repository/ent.go @@ -56,7 +56,7 @@ func InitEnt(cfg *config.Config) (*ent.Client, *sql.DB, error) { // 确保数据库 schema 已准备就绪。 // SQL 迁移文件是 schema 的权威来源(source of truth)。 // 这种方式比 Ent 的自动迁移更可控,支持复杂的迁移场景。 - migrationCtx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + migrationCtx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) defer cancel() if err := applyMigrationsFS(migrationCtx, drv.DB(), migrations.FS); err != nil { _ = drv.Close() // 迁移失败时关闭驱动,避免资源泄露