Jared Robbins
08/18/2022, 2:54 PMClint M
08/18/2022, 3:01 PMJared Robbins
08/18/2022, 3:02 PMClint M
08/18/2022, 3:04 PMJared Robbins
08/18/2022, 3:05 PMAnna Geller
08/18/2022, 3:15 PMCan i prevent the same flow from running twice at the same time while using just one work queue?that's what concurrency limits are for, but yeah 100% with the new work queue setup you can solve that by assigning a new work queue name per deployment, solving it in a really simple way
Jared Robbins
08/18/2022, 3:25 PMClint M
08/18/2022, 3:27 PMprefect agent start -q misspelledname
Jared Robbins
08/18/2022, 3:35 PMAnna Geller
08/18/2022, 3:43 PMwouldn’t it be better if we could also specify the concurrency optionsyou can do so if you create a work queue yourself using one more command:
prefect work-queue create x --limit 1
if you misspell your queue names it will just auto create the new queuethis is expected - you need to be a bit more careful here, we don't have ML yet predicting typos 😜
Clint M
08/18/2022, 3:45 PMthis is expected - you need to be a bit more careful here, we don’t have ML yet predicting typosit should throw an error instead
Anna Geller
08/18/2022, 3:46 PMJared Robbins
08/18/2022, 3:47 PMAnna Geller
08/18/2022, 3:47 PMprefect work-queue ls
Ryan Peden
08/18/2022, 5:23 PMimport asyncio
from flows import my_flow
from prefect.deployments import Deployment
from prefect.client import get_client
deployment_name = "my_flow"
work_queue_name = "my_flow_work_queue"
async def run_deployment():
# create and apply the deployment
deployment = await Deployment.build_from_flow(
flow=test_flow,
name=deployment_name,
work_queue_name=work_queue_name,
version=1
)
await deployment.apply()
# set the work queue concurrency
client = get_client()
work_queue = await client.read_work_queue_by_name(work_queue_name)
await client.update_work_queue(work_queue.id, concurrency_limit=1)
asyncio.run(run_deployment())
CLI deployments are usually simpler, but I wanted to mention this option in case it is useful!Jared Robbins
08/18/2022, 5:36 PM