mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-32281] SqlRoleStore/GetByName: add context to allow read from master (#17176)
* role_store/GetByName: add context * propagate context in the app layer * propagate context in the app layer * add missing import Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9eceeaa8db
commit
28ff4dc8d0
@@ -5929,10 +5929,10 @@ func (s *TimerLayerRoleStore) GetAll() ([]*model.Role, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRoleStore) GetByName(name string) (*model.Role, error) {
|
||||
func (s *TimerLayerRoleStore) GetByName(ctx context.Context, name string) (*model.Role, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
result, err := s.RoleStore.GetByName(name)
|
||||
result, err := s.RoleStore.GetByName(ctx, name)
|
||||
|
||||
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
|
||||
Reference in New Issue
Block a user