refactor(tcp): 优化TCP服务器连接池变量命名
- 将sqlitePool错误信息中的pool改为connPool以保持一致性 - 将ConnectionPool实例变量名从pool重命名为connPool - 更新TCPServer结构体中Connection字段的赋值引用main
parent
86116618e4
commit
d958f4c059
|
|
@ -327,7 +327,7 @@
|
|||
<entry key="file://$PROJECT_DIR$/tcp/tcp.go">
|
||||
<value>
|
||||
<ScannedPath>
|
||||
<option name="lastModified" value="1772413469943" />
|
||||
<option name="lastModified" value="1772416836034" />
|
||||
<option name="schema">
|
||||
<list>
|
||||
<option value="TCPServer" />
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ func NewTCPServer(address string, config *TcpPoolConfig) (*TCPServer, error) {
|
|||
// 初始化SQLite连接池
|
||||
sqlitePool, err := pool.NewSQLitePool()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sqlite pool: %w", err)
|
||||
return nil, fmt.Errorf("failed to create sqlite connPool: %w", err)
|
||||
}
|
||||
|
||||
pool := &ConnectionPool{
|
||||
connPool := &ConnectionPool{
|
||||
connections: make(map[string]*TcpConnection),
|
||||
sqlitePool: sqlitePool,
|
||||
config: config,
|
||||
|
|
@ -61,7 +61,7 @@ func NewTCPServer(address string, config *TcpPoolConfig) (*TCPServer, error) {
|
|||
server := &TCPServer{
|
||||
Address: address,
|
||||
Config: config,
|
||||
Connection: pool,
|
||||
Connection: connPool,
|
||||
Logger: logger,
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
|
|
|
|||
Loading…
Reference in New Issue