From 212fa340cfb499297bf76cb9dd5751895700a2af Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 27 Dec 2020 01:23:57 +0000 Subject: [PATCH] Migration: drop to long repo topics (#14152) --- modules/migrations/gitea_uploader.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/migrations/gitea_uploader.go b/modules/migrations/gitea_uploader.go index 20d7d81ae..91ddda9c3 100644 --- a/modules/migrations/gitea_uploader.go +++ b/modules/migrations/gitea_uploader.go @@ -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...) }