Dashboard Versions: Make compatible with app platform (#99327)
This commit is contained in:
@@ -41,6 +41,9 @@ type ListIterator interface {
|
||||
// The token that can be used to start iterating *after* this item
|
||||
ContinueToken() string
|
||||
|
||||
// The token that can be used to start iterating *before* this item
|
||||
ContinueTokenWithCurrentRV() string
|
||||
|
||||
// ResourceVersion of the current item
|
||||
ResourceVersion() int64
|
||||
|
||||
@@ -756,9 +759,16 @@ func (s *server) List(ctx context.Context, req *ListRequest) (*ListResponse, err
|
||||
rsp.Items = append(rsp.Items, item)
|
||||
if len(rsp.Items) >= int(req.Limit) || pageBytes >= maxPageBytes {
|
||||
t := iter.ContinueToken()
|
||||
if req.Source == ListRequest_HISTORY {
|
||||
// history lists in desc order, so the continue token takes the
|
||||
// final RV in the list, and then will start from there in the next page,
|
||||
// rather than the lists first RV
|
||||
t = iter.ContinueTokenWithCurrentRV()
|
||||
}
|
||||
if iter.Next() {
|
||||
rsp.NextPageToken = t
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user