Пример #1
0
def updateFeedInfo_ToCache ( key, content ):
    redis = db_cache.get_redis_feed_content()
    if redis == None: # error logging in db_cache
        return False

    key = key + '_fc'
    if not redis.Set( key, content ) :
        logger.error( 'updateFeedInfo_ToCache faild, key=%s, errno=%d', key, redis.GetLastErrNo() )
        return False
        
    return True
Пример #2
0
def getFeedInfo_FromCache ( key ):
    logger.debug( 'getFeedInfo_FromCache, key=%s', key )

    redis = db_cache.get_redis_feed_content()
    if redis == None: # error logging in db_cache
        return None

    key = key + '_fc'
    content = redis.Get( key )
    if content == None or content == '' :
        logger.error( "getFeedInfo_FromCache, key=%s, err=%d", key, redis.GetLastErrNo() )
        return None
        
    return content