feat: redis支持工单流程审批

This commit is contained in:
meilin.huang
2024-03-02 19:08:19 +08:00
parent 76475e807e
commit 49d3f988c9
93 changed files with 1107 additions and 1014 deletions

View File

@@ -1,13 +1,10 @@
package application
import (
"mayfly-go/internal/machine/infrastructure/persistence"
"mayfly-go/pkg/ioc"
)
func InitIoc() {
persistence.Init()
ioc.Register(new(machineAppImpl), ioc.WithComponentName("MachineApp"))
ioc.Register(new(machineFileAppImpl), ioc.WithComponentName("MachineFileApp"))
ioc.Register(new(machineScriptAppImpl), ioc.WithComponentName("MachineScriptApp"))

View File

@@ -4,7 +4,7 @@ import (
"mayfly-go/pkg/ioc"
)
func Init() {
func InitIoc() {
ioc.Register(newMachineRepo(), ioc.WithComponentName("MachineRepo"))
ioc.Register(newMachineFileRepo(), ioc.WithComponentName("MachineFileRepo"))
ioc.Register(newMachineScriptRepo(), ioc.WithComponentName("MachineScriptRepo"))

View File

@@ -6,13 +6,17 @@ import (
"mayfly-go/internal/common/consts"
"mayfly-go/internal/machine/application"
"mayfly-go/internal/machine/domain/entity"
"mayfly-go/internal/machine/infrastructure/persistence"
"mayfly-go/internal/machine/router"
"mayfly-go/pkg/eventbus"
"mayfly-go/pkg/global"
)
func init() {
initialize.AddInitIocFunc(application.InitIoc)
initialize.AddInitIocFunc(func() {
persistence.InitIoc()
application.InitIoc()
})
initialize.AddInitRouterFunc(router.Init)
initialize.AddInitFunc(Init)
}

View File

@@ -70,6 +70,12 @@ func checkClientAvailability(interval time.Duration) {
if cli.Info == nil {
continue
}
if cli.sshClient == nil {
continue
}
if cli.sshClient.Conn == nil {
continue
}
if _, _, err := cli.sshClient.Conn.SendRequest("ping", true, nil); err != nil {
logx.Errorf("machine[%s] cache client is not available: %s", cli.Info.Name, err.Error())
DeleteCli(cli.Info.Id)