Skip to content

Commit

Permalink
Migrations should not fail for comment reactions (go-gitea#13352) (go…
Browse files Browse the repository at this point in the history
…-gitea#13355)

An extension to go-gitea#13444 - where we now ensure that comment reaction failures do not cause migrations failure

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Oct 30, 2020
1 parent f825e2a commit 02edb9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/migrations/gitea_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,11 @@ func (g *GiteaDownloader) GetComments(index int64) ([]*base.Comment, error) {
for _, comment := range comments {
reactions, err := g.getCommentReactions(comment.ID)
if err != nil {
return nil, fmt.Errorf("error while listing reactions for comment %d in issue #%d. Error: %v", comment.ID, index, err)
log.Warn("Unable to load comment reactions during migrating issue #%d for comment %d to %s/%s. Error: %v", index, comment.ID, g.repoOwner, g.repoName, err)
if err2 := models.CreateRepositoryNotice(
fmt.Sprintf("Unable to load reactions during migrating issue #%d for comment %d to %s/%s. Error: %v", index, comment.ID, g.repoOwner, g.repoName, err)); err2 != nil {
log.Error("create repository notice failed: ", err2)
}
}

allComments = append(allComments, &base.Comment{
Expand Down

0 comments on commit 02edb9d

Please sign in to comment.