-
Notifications
You must be signed in to change notification settings - Fork 57
Description
docker run -p 11231:11211 -it -d --name test_memcached3 -e MEMCACHED_USERNAME=my_user -e MEMCACHED_PASSWORD=my_password bitnami/memcached:latest
=====pip install================
pip install python-binary-memcached
=======python script==============
import bmemcached
client = bmemcached.Client('127.0.0.1:11231', 'my_user', 'my_password')
client.set('user_id', 1, time=2)
if name == "main":
while True:
client.incr('user_id', 1)
hints = client.get('user_id')
print('hints:', hints)
=======issue=======
hints will never be none
Compare with normal without passcode
docker run -p 11221:11211 -it -d --name test_memcached2 bitnami/memcached:latest
pip install python-memcached
import memcache
client = memcache.Client(['127.0.0.1:11221'], debug=0)
client.set('user_id', 1, 2)
if name == "main":
while True:
client.incr('user_id', 1)
hints = client.get('user_id')
print('hints:', hints)
=====issue====
hints will be None after 2 seconds