本文整理汇总了Python中pyasm.common.Common.restart方法的典型用法代码示例。如果您正苦于以下问题:Python Common.restart方法的具体用法?Python Common.restart怎么用?Python Common.restart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.common.Common
的用法示例。
在下文中一共展示了Common.restart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import restart [as 别名]
def execute(my):
import atexit
import time
atexit.register( my.cleanup )
while 1:
my.check_existing_jobs()
my.check_new_job()
time.sleep(my.check_interval)
#DbContainer.close_thread_sql()
if my.max_jobs_completed != -1 and my.jobs_completed > my.max_jobs_completed:
Common.restart()
示例2: execute
# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import restart [as 别名]
def execute(self):
import atexit
import time
atexit.register( self.cleanup )
while 1:
self.check_existing_jobs()
self.check_new_job()
time.sleep(self.check_interval)
DbContainer.close_thread_sql()
if self.max_jobs_completed != -1 and self.jobs_completed > self.max_jobs_completed:
Common.restart()
while 1:
print("Waiting to restart...")
time.sleep(1)
示例3: open
# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import restart [as 别名]
print "Error: ", e
f = open(error_path,"w")
f.write(str(e))
f.close()
#raise
finally:
os.unlink(checkin_path)
# restart every 20 check-ins
if restart:
for path in paths:
checkin_path = "%s.checkin" % path
if os.path.exists(checkin_path):
os.unlink(checkin_path)
Common.restart()
class WatchFolderCheckFileThread(threading.Thread):
def __init__(my, **kwargs):
my.kwargs = kwargs
super(WatchFolderCheckFileThread, my).__init__()
path = my.kwargs.get("path")
my.lock_path = "%s.lock" % path
my.error_path = "%s.error" % path
my.checkin_path = "%s.checkin" % path
def run(my):