mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-26 01:16:36 +08:00
feat: 代码优化、机器计划任务完善
This commit is contained in:
@@ -12,7 +12,8 @@ import (
|
||||
"mayfly-go/pkg/cache"
|
||||
"mayfly-go/pkg/global"
|
||||
"mayfly-go/pkg/model"
|
||||
"mayfly-go/pkg/utils"
|
||||
"mayfly-go/pkg/utils/netx"
|
||||
"mayfly-go/pkg/utils/structx"
|
||||
"net"
|
||||
"regexp"
|
||||
"time"
|
||||
@@ -201,7 +202,7 @@ func connect(me *entity.Mongo) (*MongoInstance, error) {
|
||||
|
||||
func toMongiInfo(me *entity.Mongo) *MongoInfo {
|
||||
mi := new(MongoInfo)
|
||||
utils.Copy(mi, me)
|
||||
structx.Copy(mi, me)
|
||||
return mi
|
||||
}
|
||||
|
||||
@@ -212,7 +213,7 @@ type MongoSshDialer struct {
|
||||
func (sd *MongoSshDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
if sshConn, err := machineapp.GetMachineApp().GetSshTunnelMachine(sd.machineId).GetDialConn(network, address); err == nil {
|
||||
// 将ssh conn包装,否则内部部设置超时会报错,ssh conn不支持设置超时会返回错误: ssh: tcpChan: deadline not supported
|
||||
return &utils.WrapSshConn{Conn: sshConn}, nil
|
||||
return &netx.WrapSshConn{Conn: sshConn}, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user