MM-61484 - Deleting scheduled posts when permanently deleting a user (#29152)
* Deleting scheduled posts when permanently deleting a user * Updated tests * CI * Testing CI * Restored a test change * Skipping flaky test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5e47c97db4
Коммит
c79a8a8b4a
@@ -9912,6 +9912,27 @@ func (s *RetryLayerScheduledPostStore) GetScheduledPostsForUser(userId string, t
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerScheduledPostStore) PermanentDeleteByUser(userId string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ScheduledPostStore.PermanentDeleteByUser(userId)
|
||||
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 *RetryLayerScheduledPostStore) PermanentlyDeleteScheduledPosts(scheduledPostIDs []string) error {
|
||||
|
||||
tries := 0
|
||||
|
||||
Ссылка в новой задаче
Block a user