GH-11469 Migrate User.UpdateLastPictureUpdate to Sync by default (#11493)
* GH-11469 Migrate User.UpdateLastPictureUpdate to Sync by default * GH-11469 log error on failure
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
68703f9b76
Коммит
2f9d509284
@@ -212,16 +212,14 @@ func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) (*model.
|
||||
return &model.UserUpdate{New: user, Old: oldUser}, nil
|
||||
}
|
||||
|
||||
func (us SqlUserStore) UpdateLastPictureUpdate(userId string) store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
curTime := model.GetMillis()
|
||||
func (us SqlUserStore) UpdateLastPictureUpdate(userId string) *model.AppError {
|
||||
curTime := model.GetMillis()
|
||||
|
||||
if _, err := us.GetMaster().Exec("UPDATE Users SET LastPictureUpdate = :Time, UpdateAt = :Time WHERE Id = :UserId", map[string]interface{}{"Time": curTime, "UserId": userId}); err != nil {
|
||||
result.Err = model.NewAppError("SqlUserStore.UpdateLastPictureUpdate", "store.sql_user.update_last_picture_update.app_error", nil, "user_id="+userId, http.StatusInternalServerError)
|
||||
} else {
|
||||
result.Data = userId
|
||||
}
|
||||
})
|
||||
if _, err := us.GetMaster().Exec("UPDATE Users SET LastPictureUpdate = :Time, UpdateAt = :Time WHERE Id = :UserId", map[string]interface{}{"Time": curTime, "UserId": userId}); err != nil {
|
||||
return model.NewAppError("SqlUserStore.UpdateLastPictureUpdate", "store.sql_user.update_last_picture_update.app_error", nil, "user_id="+userId, http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (us SqlUserStore) ResetLastPictureUpdate(userId string) *model.AppError {
|
||||
|
||||
Ссылка в новой задаче
Block a user