We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 126791a commit 406b52bCopy full SHA for 406b52b
packages/cli/src/commands/sandbox/list.ts
@@ -158,21 +158,16 @@ export async function listSandboxes({
158
pageLimit = PAGE_LIMIT
159
}
160
161
- let remainingLimit = limit
162
const sandboxes: SandboxInfo[] = []
163
const iterator = Sandbox.list({
164
apiKey: apiKey,
165
limit: pageLimit,
166
query: { state, metadata },
167
})
168
169
- while (iterator.hasNext && (!remainingLimit || remainingLimit > 0)) {
+ while (iterator.hasNext && (!limit || sandboxes.length < limit)) {
170
const batch = await iterator.nextItems()
171
sandboxes.push(...batch)
172
-
173
- if (limit && remainingLimit) {
174
- remainingLimit -= batch.length
175
- }
176
177
178
return {
0 commit comments