Closed JWCook closed 3 years ago
Can you bump the version to 2.3.1 as well?
Done
You forgot to change the version in the pyproject.toml
file. Poetry will not be able to publish a new version without it.
Okay, updated. Is there anywhere that the __version__
in pyrate_limiter/__init__.py
is used, or can that be removed?
I think it can be removed. but I never tried that lol. My guess is, it is the classic example of "if it doesn't break, don't fix it"
Fyi, it looks like the conda-forge deployment worked as expected for 2.3.1: https://anaconda.org/conda-forge/pyrate-limiter 🎉
I also confirmed that the license file got included in the sdist on PyPI (pyrate-limiter-2.3.1.tar.gz).
I found an issue with the decorator/contextmanager I previously added: after catching a
BucketFullException
and delaying, the delayed task will run without updating the bucket. This means the total delay time will be less than expected. For example, with 26 requests at 5 requests/second, the total delay time is ~4 seconds instead of 5. Same thing for non-concurrent async functions. For concurrent async functions, tasks won't get delayed correctly after the first delay.The fix for this is to add a retry after the delay, until a task successfully acquires a bucket item. I updated the tests to check for this, and also added some more examples to the Readme.