Skip to content

Commit

Permalink
Migration: drop to long repo topics
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Dec 27, 2020
1 parent cf9d471 commit ce25460
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ func (g *GiteaLocalUploader) Close() {

// CreateTopics creates topics
func (g *GiteaLocalUploader) CreateTopics(topics ...string) error {
// ignore topics to long for the db
c := 0
for i := range topics {
if len(topics[i]) <= 50 {
topics[c] = topics[i]
c++
}
}
topics = topics[:c]
return models.SaveTopics(g.repo.ID, topics...)
}

Expand Down

0 comments on commit ce25460

Please sign in to comment.