예제 #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()
예제 #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)
예제 #3
0
def init_db():
    global db_metric_data_daily, db_metric_data_monthly

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