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


Python TaskApi.stop_tasks方法代码示例

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


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

示例1: stop

# 需要导入模块: from application.modules.tasks import TaskApi [as 别名]
# 或者: from application.modules.tasks.TaskApi import stop_tasks [as 别名]
 def stop(job_id):
     logging.info('Stopping job {0}'.format(job_id))
     job = Job.query.get(job_id)
     if job.status != 'stopped':
         TaskApi.stop_tasks(job.id)
         job.status = 'stopped'
         db.session.add(job)
         db.session.commit()
     else:
         pass
开发者ID:msimoncz,项目名称:brender,代码行数:12,代码来源:__init__.py

示例2: stop

# 需要导入模块: from application.modules.tasks import TaskApi [as 别名]
# 或者: from application.modules.tasks.TaskApi import stop_tasks [as 别名]
 def stop(self, job_id):
     print '[info] Stopping job', job_id
     # first we delete the associated jobs (no foreign keys)
     job = Job.query.get(job_id)
     if job:
         if job.status not in ['stopped', 'completed', 'failed']:
             job.status = 'stopped'
             db.session.add(job)
             db.session.commit()
             TaskApi.stop_tasks(job.id)
     else:
         print('[error] Job %d not found' % job_id)
         raise KeyError
开发者ID:EVMosaic,项目名称:flamenco,代码行数:15,代码来源:__init__.py

示例3: stop

# 需要导入模块: from application.modules.tasks import TaskApi [as 别名]
# 或者: from application.modules.tasks.TaskApi import stop_tasks [as 别名]
 def stop(self, job_id):
     logging.info("Stopped job {0}".format(job_id))
     # first we stop the associated tasks (no foreign keys)
     job = Job.query.get(job_id)
     if job:
         if job.status not in ['stopped', 'completed', 'failed']:
             job.status = 'stopped'
             db.session.add(job)
             db.session.commit()
             TaskApi.stop_tasks(job.id)
     else:
         logging.error("Job {0} not found".format(job_id))
         raise KeyError
开发者ID:dineshbhoopathy,项目名称:flamenco,代码行数:15,代码来源:__init__.py

示例4: stop

# 需要导入模块: from application.modules.tasks import TaskApi [as 别名]
# 或者: from application.modules.tasks.TaskApi import stop_tasks [as 别名]
 def stop(job_id):
     logging.info("Stopped job {0}".format(job_id))
     # first we stop the associated tasks (no foreign keys)
     job = Job.query.get(job_id)
     if job:
         if job.status not in ['canceled', 'completed', 'failed']:
             log = "Status changed from {0} to {1}".format(job.status, 'canceled')
             job.status = 'canceled'
             job.date_edit = datetime.now()
             db.session.add(job)
             db.session.commit()
             log_to_database(job_id, 'job', log)
             TaskApi.stop_tasks(job.id)
     else:
         logging.error("Job {0} not found".format(job_id))
         raise KeyError
开发者ID:pedromaltez-forks,项目名称:flamenco,代码行数:18,代码来源:__init__.py


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