possibly fixed the Redis problem, thanks Rastafarian

This commit is contained in:
mdipierro
2019-09-09 21:13:01 -07:00
parent b7202df0b9
commit 0f638f9cdf
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ from gluon import current
from gluon.storage import Storage
from gluon.contrib.redis_utils import acquire_lock, release_lock
from gluon.contrib.redis_utils import register_release_lock
from gluon._compat import to_bytes
from gluon._compat import to_native
logger = logging.getLogger("web2py.session.redis")
@@ -182,11 +182,11 @@ class MockQuery(object):
key = self.keyprefix + ':' + str(self.value)
if self.with_lock:
acquire_lock(self.db.r_server, key + ':lock', self.value, 2)
rtn = self.db.r_server.hgetall(key)
rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).items()}
if rtn:
if self.unique_key:
# make sure the id and unique_key are correct
if rtn['unique_key'] == self.unique_key:
if rtn['unique_key'] == to_native(self.unique_key):
rtn['update_record'] = self.update # update record support
else:
rtn = None