update target's cluster field when clustername modified in server.conf

master
Ulric Qin 3 years ago
parent c8e59cdd0c
commit 02dd70480d

@ -2,7 +2,7 @@
NOW = $(shell date -u '+%Y%m%d%I%M%S') NOW = $(shell date -u '+%Y%m%d%I%M%S')
RELEASE_VERSION = 5.7.0 RELEASE_VERSION = 5.7.1
APP = n9e APP = n9e
SERVER_BIN = $(APP) SERVER_BIN = $(APP)

@ -36,7 +36,10 @@ func (t *Target) Add() error {
return Insert(t) return Insert(t)
} }
return nil return DB().Model(&Target{}).Where("ident = ?", t.Ident).Updates(map[string]interface{}{
"cluster": t.Cluster,
"update_at": t.UpdateAt,
}).Error
} }
func (t *Target) FillGroup(cache map[int64]*BusiGroup) error { func (t *Target) FillGroup(cache map[int64]*BusiGroup) error {

Loading…
Cancel
Save