예제 #1
0
def cache_app_run(ID=None):
    if ID != None:
        appc = AppController()
        appc.set_app_cache(ID)
    else:
        apps = mongo_db.AppBase.find({'review': 1})
        count = apps.count()
        pool = multiprocessing.Pool(processes=10)
        for app in apps: pool.apply_async(worker, (app['_id'], ))
        pool.close()
        pool.join()
예제 #2
0
def worker(_id):
    appc = AppController()
    appc.set_app_cache(_id)
    print _id