Exemplo n.º 1
0
def process():
    db = DBUtils()
    db.create()
    data = read_from_queue()
    if len(data) > 0:
        for msg in data:
            for key, val in msg.items():
                db_record = dict(zip(["desc", "src"], [key, val]))
                db.save_data(db_record)
        print("Data received, msg_cnt: %d" % len(data))
    db.close()
Exemplo n.º 2
0
def db_info():
    db = DBUtils()
    db.create()
    db.load_data(settings.DB_RECORDS_COUNT)