Beispiel #1
0
def get_cmem_val_no_pick(server_url, key):
    """
        获取数据值 不腌制
    """
    cmem = MemcacheClient(server_url)
    val = cmem.get(key)
    return val
Beispiel #2
0
def get_cmem_val_no_pick(server_url, key):
    """
        获取数据值 不腌制
    """
    cmem = MemcacheClient(server_url)
    val = cmem.get(key)
    return val
Beispiel #3
0
def get_cmem_val(server_url, key):
    """
        获取数据值
    """
    cmem = MemcacheClient(server_url)
    val = cmem.get(key)
    if val:
        return pickle.loads(val)
    else:
        return val
Beispiel #4
0
def get_cmem_val(server_url, key):
    """
        获取数据值
    """
    cmem = MemcacheClient(server_url)
    val = cmem.get(key)
    if val:
        return pickle.loads(val)
    else:
        return val
Beispiel #5
0
def put_cmem_val(server_url, key, val):
    """
        保存CMEM值
    """
    cmem = MemcacheClient(server_url)
    old_val = pickle.loads(cmem.get(key))
    legality = _check_legality(old_val, val)
    if legality:
        val = cmem.set(key, pickle.dumps(val))
        return val
    else:
        return False
Beispiel #6
0
def put_cmem_val(server_url, key, val):
    """
        保存CMEM值
    """
    cmem = MemcacheClient(server_url)
    old_val = pickle.loads(cmem.get(key))
    legality = _check_legality(old_val, val)
    if legality:
        val = cmem.set(key, pickle.dumps(val))
        return val
    else:
        return False