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


Python Job.is_job_completed方法代码示例

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


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

示例1: test_is_job_completed

# 需要导入模块: from openquake.job import Job [as 别名]
# 或者: from openquake.job.Job import is_job_completed [as 别名]
 def test_is_job_completed(self):
     job_id = Job.from_file(helpers.get_data_path(CONFIG_FILE), 'db').job_id
     session = get_db_session("reslt", "writer")
     pairs = [('pending', False), ('running', False),
              ('succeeded', True), ('failed', True)]
     for status, is_completed in pairs:
         session.query(OqJob).update({'status': status})
         session.commit()
         self.assertEqual(Job.is_job_completed(job_id), is_completed)
开发者ID:johndouglas,项目名称:openquake,代码行数:11,代码来源:job_unittest.py

示例2: test_is_job_completed

# 需要导入模块: from openquake.job import Job [as 别名]
# 或者: from openquake.job.Job import is_job_completed [as 别名]
 def test_is_job_completed(self):
     job_id = Job.from_file(helpers.get_data_path(CONFIG_FILE), 'db').job_id
     row = OqJob.objects.get(id=job_id)
     pairs = [('pending', False), ('running', False),
              ('succeeded', True), ('failed', True)]
     for status, is_completed in pairs:
         row.status = status
         row.save()
         self.assertEqual(Job.is_job_completed(job_id), is_completed)
开发者ID:favalex,项目名称:openquake,代码行数:11,代码来源:job_unittest.py

示例3: check_job_status

# 需要导入模块: from openquake.job import Job [as 别名]
# 或者: from openquake.job.Job import is_job_completed [as 别名]
def check_job_status(job_id):
    """
    Helper function which is intended to be run by celery task functions.

    :raises JobCompletedError:
        If :meth:`~openquake.job.Job.is_job_completed` returns ``True``
        for ``job_id``.
    """
    if Job.is_job_completed(job_id):
        raise JobCompletedError(job_id)
开发者ID:favalex,项目名称:openquake,代码行数:12,代码来源:tasks.py

示例4: check_job_status

# 需要导入模块: from openquake.job import Job [as 别名]
# 或者: from openquake.job.Job import is_job_completed [as 别名]
def check_job_status(job_id):
    """
    Helper function which is intended to be run by celery task functions.

    :raises JobCompletedError:
        If :meth:`~openquake.job.Job.is_job_completed` returns ``True``
        for ``job_id``.
    """
    job = Job.from_kvs(job_id)
    level = job.params.get('debug') if job and job.params else 'warn'
    logs.init_logs_amqp_send(level=level, job_id=job_id)
    if Job.is_job_completed(job_id):
        raise JobCompletedError(job_id)
开发者ID:dsg101,项目名称:openquake,代码行数:15,代码来源:tasks.py


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