Пример #1
0
def reschedule_all_running():
    """
    Add-hoc handle. Remove after implementation of persistent task handling in copr-backend
    """
    to_reschedule = \
        BuildsLogic.get_build_tasks(StatusEnum("starting")).all() + \
        BuildsLogic.get_build_tasks(StatusEnum("running")).all()

    if to_reschedule:
        for build_chroot in to_reschedule:
            build_chroot.status = StatusEnum("pending")
            db.session.add(build_chroot)

        db.session.commit()

    return "OK", 200
Пример #2
0
def reschedule_all_running():
    """
    Add-hoc handle. Remove after implementation of persistent task handling in copr-backend
    """
    to_reschedule = \
        BuildsLogic.get_build_tasks(StatusEnum("starting")).all() + \
        BuildsLogic.get_build_tasks(StatusEnum("running")).all()

    if to_reschedule:
        for build_chroot in to_reschedule:
            build_chroot.status = StatusEnum("pending")
            db.session.add(build_chroot)

        db.session.commit()

    return "OK", 200
Пример #3
0
def reschedule_all_running():
    to_reschedule = \
        BuildsLogic.get_build_tasks(StatusEnum("starting")).all() + \
        BuildsLogic.get_build_tasks(StatusEnum("running")).all()

    for build_chroot in to_reschedule:
        build_chroot.status = StatusEnum("pending")
        db.session.add(build_chroot)

    to_reschedule = \
        BuildsLogic.get_srpm_build_tasks(StatusEnum("starting")).all() + \
        BuildsLogic.get_srpm_build_tasks(StatusEnum("running")).all()

    for build in to_reschedule:
        build.source_status = StatusEnum("pending")
        db.session.add(build)

    db.session.commit()

    return "OK", 200