I'm using prefect 2, and trying to manage concurre...
# ask-community
d
I'm using prefect 2, and trying to manage concurrency limits Using the CLI, I can do this:
Copy code
prefect gcl create dummy-api --limit 1 --slot-decay-per-second 0.2
...and this
Copy code
prefect gcl update dummy-api --limit 1 --slot-decay-per-second 0.5
But, using the python SDK, I can't supply
slot_decay_per_second
to
create_concurrency_limit
- if I try to do that, I get an error. @Marvin How can I manage
slot_decay_per_second
in python?
m
It looks like using the Prefect Python SDK to set the
slot_decay_per_second
parameter for concurrency limits isn't directly supported, which is why you're encountering an error. According to the Prefect 2.x documentation, slot decay can be configured via the CLI when creating or updating concurrency limits, as you've successfully done, but this feature isn't currently available directly in the Python SDK. For more details on managing concurrency limits, you can check this section of the documentation: Concurrency Limits in Prefect 2.x. Unfortunately, the GitHub issues search encountered a hiccup, but generally, there might be discussions there regarding the functionality, limitations, or potential workarounds. If you need to manage this through Python for now, you might have to resort to CLI commands via a subprocess call in Python, as a workaround until such functionality is added to the SDK. I guess it's one of those charming quirks of software development - sometimes the answer is "CLI it is, for now!"