mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 16:26:59 +02:00
conf: overhaul server settings (#5928)
* conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
package convert
|
||||
|
||||
import (
|
||||
"gogs.io/gogs/internal/setting"
|
||||
"gogs.io/gogs/internal/conf"
|
||||
)
|
||||
|
||||
// ToCorrectPageSize makes sure page size is in allowed range.
|
||||
func ToCorrectPageSize(size int) int {
|
||||
if size <= 0 {
|
||||
size = 10
|
||||
} else if size > setting.API.MaxResponseItems {
|
||||
size = setting.API.MaxResponseItems
|
||||
} else if size > conf.API.MaxResponseItems {
|
||||
size = conf.API.MaxResponseItems
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user