(itemkey, item, local=False)
return True
This will parse out a dictionary and return lists keys and dict values
This will parse out a dictionary and return lists keys and dict values
This will parse out a dictionary and return lists keys and dict values
def populateRedis(itemkey, item, local=False):
    '''
    This will parse out a dictionary and return lists keys and dict values
    '''
    if local is True:
        r_server.sadd(item['data']["timer"], item['cid'])
    if 'failcount' in item:
        r_server.set(itemkey + ":failcount", item['failcount'])
    if 'lastrun' in item:
        r_server.set(itemkey + ":lastrun", item['lastrun'])
    ## Encrypt data going to redis
    if "encrypted" in item:
        if item['encrypted'] is True:
            item['data'] = crypto.encrypt(json.dumps(item['data']))
    redis_data = json.dumps(item)
    try:
        r_server.set(itemkey, redis_data)
    except:
        return False
    return True
def populateRedis ( itemkey , item , local = False ) : if local is True : r_server . sadd ( item [ 'data' ] [ "timer" ] , item [ 'cid' ] ) if 'failcount' in item : r_server . set ( itemkey + ":failcount" , item [ 'failcount' ] ) if 'lastrun' in item : r_server . set ( itemkey + ":lastrun" , item [ 'lastrun' ] ) ## Encrypt data going to redis if "encrypted" in item : if item [ 'encrypted' ] is True : item [ 'data' ] = crypto . encrypt ( json . dumps ( item [ 'data' ] ) ) redis_data = json . dumps ( item ) try : r_server . set ( itemkey , redis_data ) except : return False return True