Commit Graph

3 Commits

Author SHA1 Message Date
Martyn Inglis
ac6609e653 Couple of bugs squashed.
1) It's incr not inc on the redis client, so renamed the calls everywhere
2) Redis returns bytes/string rather than an int if the value stored is an int. Cast the result to an int before use. Not you can set up the GET to do this transparently but I've not done this as we *may * use GETS for non-int and  the callback sets up the cast for the connection not the call.
2016-11-12 15:37:57 +00:00
Martyn Inglis
88f04a46cf Implemented the rate limiting from Redis
- Uses Redis cache to check for current count
- If not present then sets the value based on the database state
- Any Redis errors are swallowed. Cache failures should NOT fail  the request.
2016-11-11 16:47:52 +00:00
Martyn Inglis
6c27f8023e Added tests for setting and fetching from redis respecting the enabled flag. 2016-11-10 13:22:38 +00:00