summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-03-23 04:14:31 +0100
committerMax Magorsch <arzano@gentoo.org>2020-03-23 04:14:31 +0100
commit393a120513b68b5a7aee31474c6a98092d94d996 (patch)
tree939d47de278ebfcbe8c1789d04ef47cdaf504dc0
parentRemove logging message during mask update (diff)
downloadsoko-393a120513b68b5a7aee31474c6a98092d94d996.tar.gz
soko-393a120513b68b5a7aee31474c6a98092d94d996.tar.bz2
soko-393a120513b68b5a7aee31474c6a98092d94d996.zip
Fix the number of updated packages on the index page
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--pkg/app/handler/index/utils.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/app/handler/index/utils.go b/pkg/app/handler/index/utils.go
index f1fac16..653db29 100644
--- a/pkg/app/handler/index/utils.go
+++ b/pkg/app/handler/index/utils.go
@@ -36,7 +36,7 @@ func getUpdatedVersions(n int) []*models.Version {
var updates []models.Commit
err := database.DBCon.Model(&updates).
Order("preceding_commits DESC").
- Limit(n).
+ Limit(3*n).
Relation("ChangedVersions").
Relation("ChangedVersions.Commits", func(q *orm.Query) (*orm.Query, error) {
return q.Order("preceding_commits DESC"), nil
@@ -52,7 +52,7 @@ func getUpdatedVersions(n int) []*models.Version {
updatedVersions = append(updatedVersions, commit.ChangedVersions...)
}
if len(updatedVersions) > n {
- updatedVersions = updatedVersions[:10]
+ updatedVersions = updatedVersions[:n]
}
return updatedVersions
}