[MM-39631] mirgate user store to sqlx (#19403)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d5b24e383d
Коммит
440790dad6
@@ -11977,6 +11977,27 @@ func (s *RetryLayerUserStore) InferSystemInstallDate() (int64, error) {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) InsertUsers(users []*model.User) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.UserStore.InsertUsers(users)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if !isRepeatableError(err) {
|
||||
return err
|
||||
}
|
||||
tries++
|
||||
if tries >= 3 {
|
||||
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
|
||||
return err
|
||||
}
|
||||
timepkg.Sleep(100 * timepkg.Millisecond)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) InvalidateProfileCacheForUser(userID string) {
|
||||
|
||||
s.UserStore.InvalidateProfileCacheForUser(userID)
|
||||
|
||||
Ссылка в новой задаче
Block a user