Skip to content

Add --limit to queue flush - #1148

Open
fal2d2 wants to merge 1 commit into
mainfrom
fal2d2/queue-flush-limit
Open

Add --limit to queue flush#1148
fal2d2 wants to merge 1 commit into
mainfrom
fal2d2/queue-flush-limit

Conversation

@fal2d2

@fal2d2 fal2d2 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Adds fal queue flush APP --limit N, validates that N is positive, and sends it to the queue flush endpoint. --limit and --caller-user-id are mutually exclusive.

Depends on: https://github.com/fal-ai/isolate-cloud/pull/9377

Linear: https://linear.app/features-and-labels/issue/INFRA-4754/add-a-limit-option-to-queue-flush

Prompted by: Ishaan Mittal

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — small, well-tested CLI addition.

What was reviewed:

  • --limit validation (_positive_int) rejects 0/negative values via argparse error path.
  • Mutual exclusivity between --limit and --caller-user-id enforced by an argparse group.
  • Request params dict construction and the DELETE call for queue flush are covered by unit tests, including the params sent to the backend.
Extended reasoning...

Overview

This PR adds a --limit option to fal queue flush, letting users cap the number of pending requests flushed instead of flushing everything. It touches only projects/fal/src/fal/cli/queue.py (parser wiring + params dict construction) and adds a matching unit test file. The backend behavior for limit lives in a separate isolate-cloud PR referenced in the description, so this PR is purely the CLI-side plumbing.

Security risks

None. This is a client-side CLI change that builds a query-param dict (caller_user_id, limit) passed through httpx's params=, which handles proper encoding. No auth, crypto, or permission logic is touched.

Level of scrutiny

Low. The change is small, mechanical, and additive — a new optional flag with input validation and a mutually-exclusive constraint, following the exact pattern already used for --caller-user-id. It doesn't touch any critical or shared code paths beyond this single CLI subcommand.

Other factors

New unit tests directly exercise the added behavior: limit parsing/type-checking, the params sent to the DELETE call, rejection of non-positive limits, and rejection of combining --limit with --caller-user-id. The bug-hunting system found no issues, and my own read of the diff didn't surface any correctness or edge-case concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant