bigcommerce/bigcommerce-api-python

Rate Limit only firing once

Opened this issue · 0 comments

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''