Skip to content

Commit 02edb9d

Browse files
authored
Migrations should not fail for comment reactions (go-gitea#13352) (go-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>
1 parent f825e2a commit 02edb9d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/migrations/gitea_downloader.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ func (g *GiteaDownloader) GetComments(index int64) ([]*base.Comment, error) {
457457
for _, comment := range comments {
458458
reactions, err := g.getCommentReactions(comment.ID)
459459
if err != nil {
460-
return nil, fmt.Errorf("error while listing reactions for comment %d in issue #%d. Error: %v", comment.ID, index, err)
460+
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)
461+
if err2 := models.CreateRepositoryNotice(
462+
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 {
463+
log.Error("create repository notice failed: ", err2)
464+
}
461465
}
462466

463467
allComments = append(allComments, &base.Comment{

0 commit comments

Comments
 (0)