当前位置: 首页>>代码示例>>Python>>正文


Python SchedulerJob.heartrate方法代码示例

本文整理汇总了Python中airflow.jobs.SchedulerJob.heartrate方法的典型用法代码示例。如果您正苦于以下问题:Python SchedulerJob.heartrate方法的具体用法?Python SchedulerJob.heartrate怎么用?Python SchedulerJob.heartrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在airflow.jobs.SchedulerJob的用法示例。


在下文中一共展示了SchedulerJob.heartrate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_scheduler_process_check_heartrate

# 需要导入模块: from airflow.jobs import SchedulerJob [as 别名]
# 或者: from airflow.jobs.SchedulerJob import heartrate [as 别名]
    def test_scheduler_process_check_heartrate(self):
        """
        Test if process dag honors the heartrate
        """
        dag = DAG(
            dag_id='test_scheduler_process_check_heartrate',
            start_date=DEFAULT_DATE)
        dag_task1 = DummyOperator(
            task_id='dummy',
            dag=dag,
            owner='airflow')

        session = settings.Session()
        orm_dag = DagModel(dag_id=dag.dag_id)
        orm_dag.last_scheduler_run = datetime.datetime.now()
        session.merge(orm_dag)
        session.commit()
        session.close()

        scheduler = SchedulerJob()
        scheduler.heartrate = 1000

        dag.clear()

        dr = scheduler.schedule_dag(dag)
        self.assertIsNotNone(dr)

        queue = mock.Mock()
        scheduler.process_dag(dag, queue=queue)

        queue.put.assert_not_called()
开发者ID:GokcerBelgusen,项目名称:incubator-airflow,代码行数:33,代码来源:jobs.py

示例2: do_schedule

# 需要导入模块: from airflow.jobs import SchedulerJob [as 别名]
# 或者: from airflow.jobs.SchedulerJob import heartrate [as 别名]
 def do_schedule(function, function2):
     # Use a empty file since the above mock will return the
     # expected DAGs. Also specify only a single file so that it doesn't
     # try to schedule the above DAG repeatedly.
     scheduler = SchedulerJob(num_runs=1,
                              executor=executor,
                              subdir=os.path.join(models.DAGS_FOLDER,
                                                  "no_dags.py"))
     scheduler.heartrate = 0
     scheduler.run()
开发者ID:owlabs,项目名称:incubator-airflow,代码行数:12,代码来源:jobs.py

示例3: do_schedule

# 需要导入模块: from airflow.jobs import SchedulerJob [as 别名]
# 或者: from airflow.jobs.SchedulerJob import heartrate [as 别名]
 def do_schedule(function, function2):
     scheduler = SchedulerJob(num_runs=1, executor=executor,)
     scheduler.heartrate = 0
     scheduler.run()
开发者ID:NarekA,项目名称:incubator-airflow,代码行数:6,代码来源:jobs.py


注:本文中的airflow.jobs.SchedulerJob.heartrate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。