mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-09-26 20:11:20 +08:00
Compare commits
4 Commits
ca849de37f
...
c7cc2e36fd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c7cc2e36fd | ||
![]() |
2fabbf5c0f | ||
![]() |
e37da632df | ||
![]() |
219dcdc372 |
@@ -4,9 +4,9 @@ import (
|
||||
"errors"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/google/shlex"
|
||||
"github.com/lzh-1625/go_process_manager/config"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/eum"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/model"
|
||||
@@ -209,7 +209,7 @@ func (p *processCtlLogic) UpdateProcessConfig(config model.Process) error {
|
||||
result.Config.cpuLimit = config.CpuLimit
|
||||
result.Config.AutoRestart = config.AutoRestart
|
||||
result.Config.compulsoryRestart = config.CompulsoryRestart
|
||||
result.StartCommand = strings.Fields(config.Cmd)
|
||||
result.StartCommand = utils.UnwarpIgnore(shlex.Split(config.Cmd))
|
||||
result.WorkDir = config.Cwd
|
||||
result.Name = config.Name
|
||||
return nil
|
||||
|
@@ -139,10 +139,7 @@ func NewProcessPty(pconfig model.Process) *ProcessBase {
|
||||
StartCommand: utils.UnwarpIgnore(shlex.Split(pconfig.Cmd)),
|
||||
WorkDir: pconfig.Cwd,
|
||||
}
|
||||
processPty := ProcessPty{
|
||||
ProcessBase: &p,
|
||||
}
|
||||
p.Process = &processPty
|
||||
processPty.setProcessConfig(pconfig)
|
||||
p.Process = &ProcessPty{ProcessBase: &p}
|
||||
p.setProcessConfig(pconfig)
|
||||
return &p
|
||||
}
|
||||
|
@@ -143,10 +143,7 @@ func NewProcessStd(pconfig model.Process) *ProcessBase {
|
||||
StartCommand: utils.UnwarpIgnore(shlex.Split(pconfig.Cmd)),
|
||||
WorkDir: pconfig.Cwd,
|
||||
}
|
||||
processStd := ProcessStd{
|
||||
ProcessBase: &p,
|
||||
}
|
||||
p.Process = &processStd
|
||||
processStd.setProcessConfig(pconfig)
|
||||
p.Process = &ProcessStd{ProcessBase: &p}
|
||||
p.setProcessConfig(pconfig)
|
||||
return &p
|
||||
}
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package search
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/google/shlex"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/model"
|
||||
"github.com/lzh-1625/go_process_manager/log"
|
||||
"github.com/lzh-1625/go_process_manager/utils"
|
||||
)
|
||||
|
||||
type LogLogic interface {
|
||||
@@ -47,7 +48,7 @@ func QueryStringAnalysis(s string) (query []Query) {
|
||||
if strings.TrimSpace(s) == "" {
|
||||
return
|
||||
}
|
||||
strList := strings.Split(s, " ")
|
||||
strList := utils.UnwarpIgnore(shlex.Split(s))
|
||||
for _, v := range strList {
|
||||
switch {
|
||||
case strings.HasPrefix(v, "!^"):
|
||||
@@ -64,6 +65,5 @@ func QueryStringAnalysis(s string) (query []Query) {
|
||||
query = append(query, Query{Match, v})
|
||||
}
|
||||
}
|
||||
fmt.Printf("query: %v\n", query)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user