Merge branch 'master' into mark-as-unread

This commit is contained in:
Harrison Healey
2019-09-25 09:06:45 -04:00
37 changed files with 1668 additions and 2776 deletions

View File

@@ -246,14 +246,13 @@ func (s *{{$.Name}}{{$substoreName}}Store) {{$index}}({{$element.Params | joinPa
{{ else }}
{{$element.Results | genResultsVars}} := s.{{$substoreName}}Store.{{$index}}({{$element.Params | joinParams}})
{{ end }}
t := timemodule.Now()
elapsed := t.Sub(start)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if {{$element.Results | errorToBoolean}} {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("{{$substoreName}}Store.{{$index}}", success, float64(elapsed))
s.Root.Metrics.ObserveStoreMethodDuration("{{$substoreName}}Store.{{$index}}", success, elapsed)
}
return {{$element.Results | genResultsVars}}
}

View File

@@ -1419,7 +1419,7 @@ func (s SqlChannelStore) IsUserInChannelUseCache(userId string, channelId string
ids, err := s.GetAllChannelMembersForUser(userId, true, false)
if err != nil {
mlog.Error("SqlChannelStore.IsUserInChannelUseCache: " + err.Error())
mlog.Error("Error getting all channel members for user", mlog.Err(err))
return false
}
@@ -2008,7 +2008,7 @@ func (s SqlChannelStore) GetChannelsByIds(channelIds []string) ([]*model.Channel
_, err := s.GetReplica().Select(&channels, query, params)
if err != nil {
mlog.Error(fmt.Sprint(err))
mlog.Error("Query error getting channels by ids", mlog.Err(err))
return nil, model.NewAppError("SqlChannelStore.GetChannelsByIds", "store.sql_channel.get_channels_by_ids.app_error", nil, "", http.StatusInternalServerError)
}
return channels, nil

File diff suppressed because it is too large Load Diff