整理代码

This commit is contained in:
injoyai
2025-03-18 16:43:39 +08:00
parent 31fcc0b3a3
commit 09116ee8e8
2 changed files with 7 additions and 2 deletions

View File

@@ -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
}
//代码

View File

@@ -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