Skip to content

Commit

Permalink
update target's cluster field when clustername modified in server.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed May 8, 2022
1 parent c8e59cd commit 02dd704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion src/models/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 02dd704

Please sign in to comment.