當前位置: 首頁>>代碼示例>>Python>>正文


Python GangaThread.should_stop方法代碼示例

本文整理匯總了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'
開發者ID:akanevm,項目名稱:HCCRAB3,代碼行數:33,代碼來源:runtest_default.py


注:本文中的Ganga.Core.GangaThread.GangaThread.should_stop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。