Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade redis to 3.x #232

Closed
piraz opened this issue Nov 21, 2018 · 0 comments
Closed

Upgrade redis to 3.x #232

piraz opened this issue Nov 21, 2018 · 0 comments

Comments

@piraz
Copy link
Contributor

piraz commented Nov 21, 2018

To upgrade redis to 3.x we need to change the way we handle ttl in the session as per:

Upgrading from redis-py 2.X to 3.0

redis-py 3.0 introduces many new features but required a number of backwards incompatible changes to be made in the process. This section attempts to provide an upgrade path for users migrating from 2.X to 3.0.

Python Version Support

redis-py 3.0 now supports Python 2.7 and Python 3.4+. Python 2.6 and 3.3 support has been dropped.

Client Classes: Redis and StrictRedis

redis-py 3.0 drops support for the legacy "Redis" client class. "StrictRedis" has been renamed to "Redis" and an alias named "StrictRedis" is provided so that users previously using "StrictRedis" can continue to run unchanged.

The 2.X "Redis" class provided alternative implementations of a few commands. This confused users (rightfully so) and caused a number of support issues. To make things easier going forward, it was decided to drop support for these alternate implementations and instead focus on a single client class.

2.X users that are already using StrictRedis don't have to change the class name. StrictRedis will continue to work for the forseeable future.

2.X users that are using the Redis class will have to make changes if they use any of the following commands:

SETEX: The argument order has changed. The new order is (name, time, value).
LREM: The argument order has changed. The new order is (name, num, value).
TTL and PTTL: The return value is now always an int and matches the official Redis command (>0 indicates the timeout, -1 indicates that the key exists but that it has no expire time set, -2 indicates that the key does not exist)

@piraz piraz added this to the firenado 0.1.7.3 milestone Nov 21, 2018
@piraz piraz self-assigned this Nov 21, 2018
@piraz piraz closed this as completed in caf9827 Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant