Skip to content

Commit 212fa34

Browse files
authored
Migration: drop to long repo topics (#14152)
1 parent cf9d471 commit 212fa34

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/migrations/gitea_uploader.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ func (g *GiteaLocalUploader) Close() {
154154

155155
// CreateTopics creates topics
156156
func (g *GiteaLocalUploader) CreateTopics(topics ...string) error {
157+
// ignore topics to long for the db
158+
c := 0
159+
for i := range topics {
160+
if len(topics[i]) <= 50 {
161+
topics[c] = topics[i]
162+
c++
163+
}
164+
}
165+
topics = topics[:c]
157166
return models.SaveTopics(g.repo.ID, topics...)
158167
}
159168

0 commit comments

Comments
 (0)