vutran1710 / PyrateLimiter

⚔️Python Rate-Limiter using Leaky-Bucket Algorithm Family
https://pyratelimiter.readthedocs.io
MIT License
334 stars 36 forks source link

ImportError: cannot import name 'FileLockSQLiteBucket' #129

Closed raratiru closed 1 year ago

raratiru commented 1 year ago

Not sure if related to #128

I have this simple code that answers the solved issue #67 : (Rate limit multiple processes that are running simultaneously)

from pyrate_limiter import Duration, FileLockSQLiteBucket, Limiter, RequestRate

global_limiter = Limiter(
    RequestRate(1, Duration.SECOND),     
    bucket_class=FileLockSQLiteBucket,
)

However, this does not work after updating to version 3:

ImportError: cannot import name 'FileLockSQLiteBucket' from 'pyrate_limiter'

I am not sure that the new docs address this issue as simple as that.

Could you please advice?

vutran1710 commented 1 year ago

FileLockSQLite is not yet provide for v3.

For now you should use different file for each bucket

raratiru commented 1 year ago

OK thank you!

Downgrading to v2.10.

raratiru commented 7 months ago

Will FileLockSQLite be provided in future releases?

vutran1710 commented 7 months ago

Will FileLockSQLite be provided in future releases?

Ah sure I will add it to v3 soon. Just having too much in my plate lately

raratiru commented 7 months ago

OK, no hurry! Just wanted to confirm, thank you!