feat: 代码优化、机器计划任务完善

This commit is contained in:
meilin.huang
2023-07-21 17:07:04 +08:00
parent 7b51705f4e
commit 7f9e972828
56 changed files with 376 additions and 235 deletions

View File

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