示例#1
0
    def write_record(cls, record):
        """Writes a record to the database.

        :param PipelineStore record:
        """
        Session.merge(record)
        Session.commit()
示例#2
0
    def write_record(cls, record):
        """Writes a record to the database.

        :param PipelineStore record:
        """
        Session.merge(record)
        Session.commit()
示例#3
0
    def write_record(cls, record):
        """Writes a record to the database.

        :param TaskConnectionStore record:
        """
        Session.merge(record)
        Session.commit()
示例#4
0
    def write_record(cls, record):
        """Writes a record to the database.

        :param TaskConnectionStore record:
        """
        Session.merge(record)
        Session.commit()
示例#5
0
文件: task.py 项目: minglecm/ocelot
    def fetch_task_by_id(cls, id):
        """Fetches task record by id.

        :param str id:
        :returns TaskStore: record
        """
        return (Session.query(TaskStore).filter(TaskStore.id == id).one())
示例#6
0
    def fetch_pipeline_by_id(cls, id):
        """Returns pipeline record by id.

        :param str id:
        :returns PipelineStore: record
        """
        return (Session.query(PipelineStore).filter(
            PipelineStore.id == id).one())
示例#7
0
    def fetch_connections_for_pipeline(cls, pipeline_id):
        """Fetches list of task connections for a pipeline id.

        :param str pipeline_id:
        :returns list: TaskConnectionStore
        """
        return (Session.query(TaskConnectionStore).filter(
            TaskConnectionStore.pipeline_id == pipeline_id)).all()
示例#8
0
    def fetch_connections_for_pipeline(cls, pipeline_id):
        """Fetches list of task connections for a pipeline id.

        :param str pipeline_id:
        :returns list: TaskConnectionStore
        """
        return (
            Session.query(TaskConnectionStore)
            .filter(TaskConnectionStore.pipeline_id == pipeline_id)
        ).all()
示例#9
0
    def fetch_pipeline_by_id(cls, id):
        """Returns pipeline record by id.

        :param str id:
        :returns PipelineStore: record
        """
        return (
            Session.query(PipelineStore)
            .filter(PipelineStore.id == id)
            .one()
        )
示例#10
0
    def fetch_schedule_for_pipeline(cls, pipeline_id):
        """Returns PipelineScheduleStore for a pipeline_id.

        :param str pipeline_id:
        :returns PipelineScheduleStore:
        """
        return (
            Session.query(PipelineScheduleStore)
            .filter(PipelineScheduleStore.pipeline_id == pipeline_id)
            .one()
        )
示例#11
0
    def fetch_schedules_to_run(cls):
        """Return a list of PipelineScheduleStores that need to run.

        :returns list: PipelineScheduleStore
        """
        return (
            Session.query(PipelineScheduleStore)
            .filter(PipelineScheduleStore.next_run_at <= datetime.utcnow())
            .filter(PipelineScheduleStore.locked == False)  # noqa
            .all()
        )
示例#12
0
文件: task.py 项目: dentafrice/ocelot
    def fetch_task_by_id(cls, id):
        """Fetches task record by id.

        :param str id:
        :returns TaskStore: record
        """
        return (
            Session.query(TaskStore)
            .filter(TaskStore.id == id)
            .one()
        )