alert event modify filling user detail
This commit is contained in:
parent
72573e32cb
commit
31a03aa331
|
@ -506,7 +506,7 @@ func (s *Stra) Decode() error {
|
|||
return err
|
||||
}
|
||||
|
||||
s.NotifyUserDetail, err = UserGets(s.NotifyUser, 10000, 0, "")
|
||||
s.NotifyUserDetail, err = UserGetsByIds(s.NotifyUser)
|
||||
if err != nil {
|
||||
logger.Errorf("decode strategy(%d) on NotifyUserDetail fail: %v", s.Id, err)
|
||||
return err
|
||||
|
|
|
@ -341,6 +341,12 @@ func UserTotal(ids []int64, where string, args ...interface{}) (int64, error) {
|
|||
return session.Count(new(User))
|
||||
}
|
||||
|
||||
func UserGetsByIds(ids []int64) ([]User, error) {
|
||||
var users []User
|
||||
err := DB["rdb"].In("id", ids).Find(&users)
|
||||
return users, err
|
||||
}
|
||||
|
||||
func UserGets(ids []int64, limit, offset int, where string, args ...interface{}) ([]User, error) {
|
||||
session := DB["rdb"].Limit(limit, offset).OrderBy("username")
|
||||
if len(ids) > 0 {
|
||||
|
|
|
@ -90,7 +90,7 @@ func (self StatsdReporter) handleActions(actions []action) {
|
|||
switch action.actionType {
|
||||
case "report":
|
||||
previousState := StatsdState{}.RollState()
|
||||
//previousState.Summarize() // 指标进一步聚合,得到类似<all>的tag值
|
||||
previousState.Summarize() // 指标进一步聚合,得到类似<all>的tag值
|
||||
|
||||
// 第一个统计周期不准确, 扔掉
|
||||
if isFirstPeriod {
|
||||
|
|
Loading…
Reference in New Issue