Modified updateUserNotifyProps to directly update the field (#18097)

* Modified updateUserNotifyProps to directly update the field

The method was only being used during import and it unnecessarily
made multiple queries to the DB.

Changed to a separate query that just updated the props field.

https://community-daily.mattermost.com/plugins/focalboard/workspace/zyoahc9uapdn3xdptac6jb69ic?id=285b80a3-257d-41f6-8cf4-ed80ca9d92e5&v=495cdb4d-c13a-4992-8eb9-80cfee2819a4&c=e4f9a891-85d6-4886-8590-1e327f7f8b8f

```release-note
NONE
```

* invalidating cache

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-08-17 14:21:41 +05:30
коммит произвёл GitHub
родитель d181ae9262
Коммит 132f114793
12 изменённых файлов: 117 добавлений и 34 удалений

Просмотреть файл

@@ -9634,6 +9634,22 @@ func (s *TimerLayerUserStore) UpdateMfaSecret(userID string, secret string) erro
return err
}
func (s *TimerLayerUserStore) UpdateNotifyProps(userID string, props map[string]string) error {
start := timemodule.Now()
err := s.UserStore.UpdateNotifyProps(userID, props)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateNotifyProps", success, elapsed)
}
return err
}
func (s *TimerLayerUserStore) UpdatePassword(userID string, newPassword string) error {
start := timemodule.Now()