Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Andy R. Terrel
    Howdy, I'm having a bit of trouble with flask-limiter and redis. I keep getting an error about flask-limiter trying to release an unlocked lock. See https://gist.github.com/aterrel/ab624efd82c2fa5f3c95 . Any idea what the issue might be here? I have two nodes pointed at the same redis instance if that is of consequence.
    Ali-Akber Saifee
    Hi @aterrel . Sorry for the delay in getting back to you. I've hit that error before when testing out the redis sentinel implementation (alisaifee/limits#4).
    see the last few comments in that PR
    I traced the exception itself down to a minor bug in redispy - andymccurdy/redis-py#661
    however it occurs (i think) due to an inability to acquire the lock in the first place within the specified timeout
    Marques Johansson
    @alisaifee can you push the 0.9.3 tag -- my CI needs the tag to kickstart. Thanks.
    Alex Rebert
    Hi, I got the following exception
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1610, in full_dispatch_request
        rv = self.preprocess_request()
      File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1831, in preprocess_request
        rv = func()
      File "/usr/local/lib/python3.6/site-packages/flask_limiter/extension.py", line 400, in __check_request_limit
      File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
        raise value
      File "/usr/local/lib/python3.6/site-packages/flask_limiter/extension.py", line 365, in __check_request_limit
        if not self.limiter.hit(lim.limit, lim.key_func(), limit_scope):
      File "/usr/local/lib/python3.6/site-packages/limits/strategies.py", line 130, in hit
        self.storage().incr(item.key_for(*identifiers), item.get_expiry())
      File "/usr/local/lib/python3.6/site-packages/limits/storage.py", line 160, in incr
      File "/usr/local/lib/python3.6/site-packages/limits/storage.py", line 148, in __schedule_expiry
      File "/usr/local/lib/python3.6/threading.py", line 842, in start
        raise RuntimeError("threads can only be started once")
    RuntimeError: threads can only be started once
    It looks like a race could happen in __schedule_expiry, but I'm not sure if it's meant to be thread-safe or not.
    Hi everyone, anyone have experience with using flask-limiter in combination with flask-restplus?
    Aadi Bajpai
    Hi, I was hoping to use Flask Limiter on pythonanywhere but pythonanywhere actually stores the original IP address in a custom header
    How would I factor in that while setting up the limiter?