From 09116ee8e8de07c8f547e360237f4a6a738d44fc Mon Sep 17 00:00:00 2001 From: injoyai <1113655791@qq.com> Date: Tue, 18 Mar 2025 16:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manage.go | 8 ++++++-- pool.go | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/manage.go b/manage.go index c37dc6e..e78148b 100644 --- a/manage.go +++ b/manage.go @@ -7,6 +7,10 @@ import ( "time" ) +const ( + DefaultDatabaseDir = "./data/database" +) + func NewManage(cfg *ManageConfig, op ...client.Option) (*Manage, error) { //初始化配置 if cfg == nil { @@ -16,10 +20,10 @@ func NewManage(cfg *ManageConfig, op ...client.Option) (*Manage, error) { cfg.Hosts = Hosts } if cfg.CodesDir == "" { - cfg.CodesDir = "./data/database" + cfg.CodesDir = DefaultDatabaseDir } if cfg.WorkdayDir == "" { - cfg.WorkdayDir = "./data/database" + cfg.WorkdayDir = DefaultDatabaseDir } //代码 diff --git a/pool.go b/pool.go index 59c3751..b6685e7 100644 --- a/pool.go +++ b/pool.go @@ -5,6 +5,7 @@ import ( "github.com/injoyai/base/safe" ) +// NewPool 简易版本的连接池 func NewPool(dial func() (*Client, error), number int) (*Pool, error) { if number <= 0 { number = 1