本文整理汇总了Python中Ganga.Core.GangaThread.GangaThread.should_stop方法的典型用法代码示例。如果您正苦于以下问题:Python GangaThread.should_stop方法的具体用法?Python GangaThread.should_stop怎么用?Python GangaThread.should_stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ganga.Core.GangaThread.GangaThread
的用法示例。
在下文中一共展示了GangaThread.should_stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GangaThread
# 需要导入模块: from Ganga.Core.GangaThread import GangaThread [as 别名]
# 或者: from Ganga.Core.GangaThread.GangaThread import should_stop [as 别名]
ct = GangaThread(name="HCMonitorThread", target=hc_monitor_thread)
logger.info('Connected to DB')
if len(jobs):
# Wait one minute, to let the minute counter update, and avoid
# problems with the at command submitting on second = 0
test_sleep(60)
ct.start()
test_sleep(60)
while (test_active() and not test_paused()):
test = Test.objects.get(pk=testid)
# logger.info('HC Copy Thread: TOP OF MAIN LOOP')
for job in jobs:
if not test_active() or test_paused() or ct.should_stop():
break
copyJob(job)
test_sleep(10)
logger.info('Main thread exited.')
else:
logger.warning('No jobs to monitor. Exiting now.')
#Stop thread.
ct.stop()
paused = test_paused()
if not paused:
test.state = 'completed'