Example #1
0
def init_db():
    global db_raw_articles, db_parsed_articles, db_analyzed_articles,\
            db_metric_data_daily, db_metric_data_monthly

    # Init DB
    db_raw_articles = mongo.get_raw_articles()
    db_parsed_articles = mongo.get_parsed_articles()
    db_analyzed_articles = mongo.get_analyzed_articles()
    db_metric_data_daily = mongo.get_metric_data_daily()
    db_metric_data_monthly = mongo.get_metric_data_monthly()
Example #2
0
def init_db_and_queue():
    global db_analyzed_articles, db_metric_data_daily, db_metric_data_monthly,\
            connection, consume_channel

    # Init DB
    db_analyzed_articles = mongo.get_analyzed_articles()
    db_metric_data_daily = mongo.get_metric_data_daily()
    db_metric_data_monthly = mongo.get_metric_data_monthly()

    # Init connection and channels to RabbitMQ
    connection, consume_channel = queue.init_connection()
    queue.init_analyzed_articles(consume_channel)
Example #3
0
def init_db_and_queue():
    global db_parsed_articles, db_analyzed_articles, connection, \
            consume_channel, publish_channel

    # Init DB
    db_parsed_articles = mongo.get_parsed_articles()
    db_analyzed_articles = mongo.get_analyzed_articles()

    # Init connection and channels to RabbitMQ
    connection, consume_channel = queue.init_connection()
    queue.init_parsed_articles(consume_channel)

    publish_channel = connection.channel()
    queue.init_analyzed_articles(publish_channel, True)