autorun 타이밍 변경. Query를 먼저 보내고 해야 함
This commit is contained in:
@ -327,32 +327,6 @@ func NewClient(standalone bool) (HoustonClient, error) {
|
|||||||
|
|
||||||
case newClient := <-hc.clientChan:
|
case newClient := <-hc.clientChan:
|
||||||
op = protos.NewOperationClient(newClient)
|
op = protos.NewOperationClient(newClient)
|
||||||
if autorun != nil && len(*autorun) > 0 {
|
|
||||||
hascount := strings.Split(*autorun, "/")
|
|
||||||
var service string
|
|
||||||
count := 1
|
|
||||||
if len(hascount) > 1 {
|
|
||||||
service = hascount[0]
|
|
||||||
count, _ = strconv.Atoi(hascount[1])
|
|
||||||
} else {
|
|
||||||
service = *autorun
|
|
||||||
}
|
|
||||||
|
|
||||||
if cmd, ok := hc.config.Autorun[service]; ok {
|
|
||||||
// service 서비스
|
|
||||||
for i := 0; i < count; i++ {
|
|
||||||
sr := shared.StartProcessRequest{
|
|
||||||
Name: service,
|
|
||||||
Version: cmd.Version,
|
|
||||||
Args: append([]string{cmd.Exec}, cmd.Args...),
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := hc.startChildProcess(&sr, op); err != nil {
|
|
||||||
logger.Println("startChildProcess failed by autorun :", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case exited := <-exitChan:
|
case exited := <-exitChan:
|
||||||
var newprocs []*procmeta
|
var newprocs []*procmeta
|
||||||
@ -616,6 +590,35 @@ func (hc *houstonClient) checkOperation(client *grpc.ClientConn) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if autorun != nil && len(*autorun) > 0 {
|
||||||
|
hascount := strings.Split(*autorun, "/")
|
||||||
|
var service string
|
||||||
|
count := 1
|
||||||
|
if len(hascount) > 1 {
|
||||||
|
service = hascount[0]
|
||||||
|
count, _ = strconv.Atoi(hascount[1])
|
||||||
|
} else {
|
||||||
|
service = *autorun
|
||||||
|
}
|
||||||
|
|
||||||
|
if cmd, ok := hc.config.Autorun[service]; ok {
|
||||||
|
// service 서비스
|
||||||
|
for i := 0; i < count; i++ {
|
||||||
|
sr := shared.StartProcessRequest{
|
||||||
|
Name: service,
|
||||||
|
Version: cmd.Version,
|
||||||
|
Args: append([]string{cmd.Exec}, cmd.Args...),
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := hc.startChildProcess(&sr, op); err != nil {
|
||||||
|
logger.Println("startChildProcess failed by autorun :", err)
|
||||||
|
} else {
|
||||||
|
logger.Println("autorun success :", sr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
update, err := cl.Recv()
|
update, err := cl.Recv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user