Exemplo n.º 1
0
def generate_all_tables():
    chained_job = ChainedBackgroundJob(steps=[
        RefreshCanvasDataCatalog(),
        GenerateIntermediateTables(),
        IndexEnrollments(),
        GenerateBoacAnalytics(),
    ], )
    job_started = chained_job.run_async()
    return respond_with_status(job_started)
Exemplo n.º 2
0
def generate_all_tables():
    chained_job = ChainedBackgroundJob(steps=[
        CreateCanvasSchema(),
        CreateSisSchema(),
        GenerateIntermediateTables(),
        GenerateBoacAnalytics(),
    ], )
    job_started = chained_job.run_async()
    return respond_with_status(job_started)
Exemplo n.º 3
0
def import_student_population():
    chained_job = ChainedBackgroundJob(steps=[
        CreateCoeSchema(),
        ImportAscAthletes(),
        GenerateAscProfiles(),
        ImportCalNetData(),
        CreateCalNetSchema(),
    ], )
    job_started = chained_job.run_async()
    return respond_with_status(job_started)
Exemplo n.º 4
0
def full_caliper_import():
    args = get_json_args(request)
    if args:
        truncate_lrs = args.get('truncate_lrs')
    else:
        truncate_lrs = False
    chained_job = ChainedBackgroundJob(steps=[
        ImportLrsIncrementals(truncate_lrs=truncate_lrs),
        TransformLrsIncrementals(),
        MigrateLrsIncrementals(),
    ], )
    job_started = chained_job.run_async()
    return respond_with_status(job_started)
Exemplo n.º 5
0
def start_chained_job(job_components, job_id, job_opts={}):
    from nessie.jobs.background_job import ChainedBackgroundJob
    job_opts['lock_id'] = PG_ADVISORY_LOCK_IDS[job_id]
    app.logger.info('Starting chained background job: ' + ', '.join([c.__name__ for c in job_components]))
    with app.app_context():
        initialized_components = [c() for c in job_components]
        ChainedBackgroundJob(steps=initialized_components).run_async(**job_opts)