直接上代码: def utils_cache_lpop_gps(): try: data = cache.get_cache(REDIS_CONFIG, "friend").lpop(CACHE_FRIEND_PREFIX[1][0]) if data: gps_data = json.loads(data) return gps_data else: return [] except Exception as e: logging.error('e=' + repr(e)) return [] def utils_cache_blpop_gps(timeout_sec=1): try: queue, data = cache.get_cache(REDIS_CONFIG, "friend").blpop(CACHE_FRIEND_PREFIX[1][0], timeout_sec) if queue: gps_data = json.loads(data) return gps_data else: return [] except Exception as e: logging.error('e=' + repr(e)) return []