This commit is contained in:
Ulric Qin 2020-03-25 19:12:01 +08:00
parent 9cd97e4f5c
commit 72a333fad9
6 changed files with 12 additions and 12 deletions

View File

@ -79,7 +79,7 @@ func NodeQueryPath(query string, limit int) (nodes []Node, err error) {
func TreeSearchByPath(query string) (nodes []Node, err error) {
session := DB["mon"].NewSession()
defer session.Clone()
defer session.Close()
if strings.Contains(query, " ") {
arr := strings.Fields(query)

View File

@ -20,7 +20,7 @@ type Team struct {
func (t *Team) Del() error {
session := DB["uic"].NewSession()
defer session.Clone()
defer session.Close()
if err := session.Begin(); err != nil {
return err

View File

@ -18,9 +18,9 @@ func init() {
}
func Update() error {
strategys := stra.GetLogCollects()
strategies := stra.GetLogCollects()
err := UpdateGlobalStrategy(strategys)
err := UpdateGlobalStrategy(strategies)
if err != nil {
logger.Errorf("Update Strategy cache error ! [msg:%v]", err)
return err

View File

@ -146,8 +146,8 @@ func DeepCopyStringMap(p map[string]string) map[string]string {
const PATTERN_EXCLUDE_PARTITION = "```EXCLUDE```"
func parsePattern(strategys []*Strategy) {
for _, st := range strategys {
func parsePattern(strategies []*Strategy) {
for _, st := range strategies {
patList := strings.Split(st.Pattern, PATTERN_EXCLUDE_PARTITION)
if len(patList) == 1 {
@ -163,8 +163,8 @@ func parsePattern(strategys []*Strategy) {
}
}
func updateRegs(strategys []*Strategy) {
for _, st := range strategys {
func updateRegs(strategies []*Strategy) {
for _, st := range strategies {
st.TagRegs = make(map[string]*regexp.Regexp, 0)
st.ParseSucc = false

View File

@ -20,6 +20,6 @@ func loopDetect() {
func detect() {
ps := stra.GetProcCollects()
DelNoPorcCollect(ps)
AddNewPorcCollect(ps)
DelNoProcCollect(ps)
AddNewProcCollect(ps)
}

View File

@ -9,7 +9,7 @@ var (
ProcsWithScheduler = make(map[string]*ProcScheduler)
)
func DelNoPorcCollect(newCollect map[string]*model.ProcCollect) {
func DelNoProcCollect(newCollect map[string]*model.ProcCollect) {
for currKey, currProc := range Procs {
newProc, ok := newCollect[currKey]
if !ok || currProc.LastUpdated != newProc.LastUpdated {
@ -18,7 +18,7 @@ func DelNoPorcCollect(newCollect map[string]*model.ProcCollect) {
}
}
func AddNewPorcCollect(newCollect map[string]*model.ProcCollect) {
func AddNewProcCollect(newCollect map[string]*model.ProcCollect) {
for target, newProc := range newCollect {
if _, ok := Procs[target]; ok && newProc.LastUpdated == Procs[target].LastUpdated {
continue