mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: force no paging limit for list (#17354)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -567,6 +567,7 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
|
||||
var err error
|
||||
var maxLimit int64 = consts.GetMaxPagingLimit()
|
||||
limit, _ := query.Int("limit")
|
||||
forceNoPaging := jsonutils.QueryBoolean(query, "force_no_paging", false)
|
||||
offset, _ := query.Int("offset")
|
||||
pagingMarker, _ := query.GetString("paging_marker")
|
||||
pagingOrderStr, _ := query.GetString("paging_order")
|
||||
@@ -779,6 +780,10 @@ func ListItems(manager IModelManager, ctx context.Context, userCred mcclient.Tok
|
||||
}
|
||||
}
|
||||
|
||||
if forceNoPaging {
|
||||
limit = 0
|
||||
}
|
||||
|
||||
if pagingConf != nil {
|
||||
if limit > 0 {
|
||||
q = q.Limit(int(limit) + 1)
|
||||
|
||||
Reference in New Issue
Block a user