kombu icon indicating copy to clipboard operation
kombu copied to clipboard

Annotate and refactor limits.py

Open sondrelg opened this issue 3 years ago • 2 comments

Relates to #1511

Adds annotations to utils/limits.py, but notably also removes and refactors some code.

Would understand if the refactoring isn't wanted, but AFAICT the file is not a part of the public API, and the code is completely unused. Annotating this code is also made a little harder by this fact.

Specifically this removes the add, pop, and clear_pending methods on the TokenBucket class. This seems to be the commit where they were added - but they're not implemented here either: https://github.com/celery/kombu/commit/946c59c55953375ab72cd821335e21adc3293109. No tests were broken by the removal and I can only see one place where the class is accessed. None of the downstream uses from that one property call any of these methods.

sondrelg avatar Apr 12 '22 18:04 sondrelg

Done @auvipy 👍

sondrelg avatar Apr 19 '22 08:04 sondrelg

@Kludex can you have a look

auvipy avatar Apr 19 '22 11:04 auvipy