mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-05-04 10:05:18 +08:00
feat: redis支持工单流程审批
This commit is contained in:
@@ -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"))
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user