本文整理匯總了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'