bigcommerce / bigcommerce-api-python

Python client library for Bigcommerce API
https://pypi.python.org/pypi/bigcommerce
MIT License
91 stars 82 forks source link

Rate Limit only firing once #116

Open zlever01 opened 1 year ago

zlever01 commented 1 year ago

I have this code for rate limiting:


def ratelimit():
    print("Ratelimit Called")

api = bigcommerce.api.BigcommerceApi(client_id='xxxx', store_hash='xxxx,
                                     access_token='xxxx',
                                     rate_limiting_management={'min_requests_remaining': 3,
                                                               'wait': True,
                                                               'callback_function': ratelimit()})

for product in api.Products.iterall(): 

      ...

The rate limit function is only being fired once at the start of the program, and I'm getting this error:

bigcommerce.exception.RateLimitingException: 429 Too Many Requests @ products: b''