Replies: 1 comment 1 reply
-
|
Heya! There's a few options depending on your needs. Per-job, partitioned rate limits (#11) is coming with v0.26 in #58, but given the scope of that release it may be a bit. Until then, queues are cheap, and queues support global rate limiting. So you could do: async with Chancy("postgresql://localhost/postgres") as chancy:
await chancy.declare(
Queue(name="my_rate_limited_queue", rate_limit=10, rate_limit_window=60)
)If this is just one task, you could also add a strong guarantee to prevent duplicates using with_unique_key, which will only allow one of that job to ever run at the same time. And if it's more like "once a day at 5PM" you can use the Cron plugin, which supports job schedules and ensures duplicates never run. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What an amazing project, thank you for sharing this.
I'm very interested to see if chancy can be setup to run jobs on a throttle. What I mean is, I need to run a job every but due to licensing etc. that interval can't be more than some within a time period?
the job might only take 1s to run, but I would like chancy to limit how often it runs based on some 'throttle' we define.
hope this makes sense.
this is a very very cool project :)
Beta Was this translation helpful? Give feedback.
All reactions