def _get_props(self): props = lc.get(self._props_name) if props is None: props = rdb.get(self._props_db_key) or '' props = props and json.loads(props) or {} lc.set(self._props_name, props) return props
def _get_props(self): props = lc.get(self._props_name) if props is None: props = rdb.get(self._props_db_key) or "" props = json.loads(props) if props else {} lc.set(self._props_name, props) return props
def _get_props(self): """优先读本地缓存, 若没有再读redis中的值, 并更新本地缓存""" props = lc.get(self._props_name) if props is None: props = rdb.get(self._props_db_key) or '' props = props and json.loads(props) or {} lc.set(self._props_name, props) return props