Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/cli/serverless/dataimport/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func ListCmd(h *internal.Helper) *cobra.Command {

cmd.Annotations[telemetry.ClusterID] = clusterID

total, importTasks, err := cloud.RetrieveImports(cmd.Context(), clusterID, h.QueryPageSize, d)
total, importTasks, err := cloud.RetrieveImports(cmd.Context(), clusterID, h.QueryPageSize, d, true)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/service/cloud/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func GetSelectedRestoreMode() (string, error) {
// GetSelectedImport get the selected import task. statusFilter is used to filter the available options, only imports has status in statusFilter will be available.
// statusFilter with no filter will mark all the import tasks as available options just like statusFilter with all status.
func GetSelectedImport(ctx context.Context, cID string, pageSize int64, client TiDBCloudClient, statusFilter []imp.ImportStateEnum) (*Import, error) {
_, importItems, err := RetrieveImports(ctx, cID, pageSize, client)
_, importItems, err := RetrieveImports(ctx, cID, pageSize, client, false)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -733,7 +733,7 @@ func RetrieveServerlessBackups(ctx context.Context, cID string, pageSize int32,
return int64(len(items)), items, nil
}

func RetrieveImports(context context.Context, cID string, pageSize int64, d TiDBCloudClient) (int64, []imp.Import, error) {
func RetrieveImports(context context.Context, cID string, pageSize int64, d TiDBCloudClient, fetchAll bool) (int64, []imp.Import, error) {
orderBy := "create_time desc"
ps := int32(pageSize)
var items []imp.Import
Expand All @@ -743,7 +743,7 @@ func RetrieveImports(context context.Context, cID string, pageSize int64, d TiDB
}
items = append(items, imports.Imports...)
var pageToken *string
for {
for fetchAll {
pageToken = imports.NextPageToken
if util.IsNilOrEmpty(pageToken) {
break
Expand Down
Loading