Skip to content

Commit 252a382

Browse files
committed
fix(api): allow forking up to concurrency limit from named snapshot
Unlike /sandboxes/{id}/fork where the source sandbox occupies a slot, /snapshots/{id}/fork has no running source sandbox. Using >= rejected count == limit even when all slots were free. Changed to > so users can fork up to their full concurrency limit in one request.
1 parent 5eb717c commit 252a382

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/api/internal/handlers/snapshot_fork.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ func (a *APIStore) PostSnapshotsSnapshotIDFork(c *gin.Context, rawSnapshotID api
7676
return
7777
}
7878

79-
if int64(forkCount) >= teamInfo.Limits.SandboxConcurrency {
80-
a.sendAPIStoreError(c, http.StatusBadRequest, fmt.Sprintf("Count must be lower than the maximum number of concurrent sandboxes (%d)", teamInfo.Limits.SandboxConcurrency))
79+
if int64(forkCount) > teamInfo.Limits.SandboxConcurrency {
80+
a.sendAPIStoreError(c, http.StatusBadRequest, fmt.Sprintf("Count must not exceed the maximum number of concurrent sandboxes (%d)", teamInfo.Limits.SandboxConcurrency))
8181
return
8282
}
8383

0 commit comments

Comments
 (0)