server icon indicating copy to clipboard operation
server copied to clipboard

allow query limit override in get_runs_in_queue

Open jacksund opened this issue 4 years ago • 1 comments

Summary

This extends the graphql endpoint for get_runs_in_queue. Rather than being entirely dependent on the configuration kwarg queued_runs_returned_limit, it also allows the limit to be overwritten in individual calls.

Because the query already uses the limit tag, this should have no effect on query performance.

Importance

From discussions with @madkinsz on slack

Some target applications require Agents that query for a fixed number of flows at a time. While this can be set when using Prefect Server config settings, we'd also like to expose this setting to Prefect Agents (and by extension Prefect Cloud users).

As an example use case, other workflow managements softwares (such as Fireworks) rely on querying/deploying 1 flow at a time in an ad-hoc style. This feature would facilitate transitioning from Fireworks to Prefect and would also enable their use cases.

Checklist

This PR:

  • [ ] adds new tests (if appropriate)
  • [ ] adds a change file in the changes/ directory (if appropriate)

jacksund avatar Sep 09 '21 15:09 jacksund

I haven't added tests for this yet because I'd like to see if this feature would be accepted first.

jacksund avatar Sep 09 '21 15:09 jacksund

Sorry this stagnated, I can barely remember the original internal discussion but I do not think we want to support this pattern in Cloud.

As always, thanks for your contributions jacksund.

zanieb avatar Aug 23 '22 15:08 zanieb

No worries! I was able to get around my issue thanks to the new queues / agent api in v2. So this feature isn't necessary anymore anyways. :smile:

jacksund avatar Aug 23 '22 15:08 jacksund