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

This commit is contained in:
Ulric Qin 2022-05-08 16:02:50 +08:00
parent c8e59cdd0c
commit 02dd70480d
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -36,7 +36,10 @@ func (t *Target) Add() error {
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 {