From 41b58066e7bf09259a7a549af63437a079e4ccd6 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 13 Apr 2023 11:02:37 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Amysql=E8=BF=9E=E6=8E=A5=E6=95=B0?= =?UTF-8?q?=E8=B0=83=E6=88=90300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/mysql/mysql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/mysql/mysql.go b/resource/mysql/mysql.go index b1bb3c0..2dda38e 100644 --- a/resource/mysql/mysql.go +++ b/resource/mysql/mysql.go @@ -51,8 +51,8 @@ func init() { if d, err := Db.DB(); err == nil { d.SetConnMaxLifetime(time.Minute * 30) // 连接可复用的最大时间。 - d.SetMaxIdleConns(500) // 空闲连接数 - d.SetMaxOpenConns(500) // 最大连接数 + d.SetMaxIdleConns(300) // 空闲连接数 + d.SetMaxOpenConns(300) // 最大连接数 if err := d.Ping(); err != nil { fmt.Printf("database ping error %v", err) } -- 2.22.0