From d826afbe15c85c2cb94b0320042c2531c7d6e811 Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 17 Jun 2026 11:07:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(db):=20=E4=B8=BA=20deadpool-postgres=20?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=B1=A0=E6=8C=87=E5=AE=9A=20Tokio1=20runtim?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/pool.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db/pool.rs b/src/db/pool.rs index 8a3eec9..f22512c 100644 --- a/src/db/pool.rs +++ b/src/db/pool.rs @@ -7,7 +7,7 @@ use std::sync::LazyLock; use std::time::Duration; -use deadpool_postgres::{Manager, ManagerConfig, Pool, RecyclingMethod}; +use deadpool_postgres::{Manager, ManagerConfig, Pool, RecyclingMethod, Runtime}; use tokio_postgres::NoTls; /// 全局数据库连接池,基于 `DATABASE_URL` 环境变量延迟初始化。 @@ -35,6 +35,7 @@ pub static DB_POOL: LazyLock = LazyLock::new(|| { .wait_timeout(Some(Duration::from_secs(10))) .create_timeout(Some(Duration::from_secs(10))) .recycle_timeout(Some(Duration::from_secs(5))) + .runtime(Runtime::Tokio1) .build() .expect("Failed to create database connection pool") });