span8
span4
我们使用一个文件和python代码来实现这一点。
这是我们的做法,但你可以适应适合你的情况:
下面是python代码:
导入fmeobjects导入操作系统类同步调度(对象):def _init__(self): self。lockFilePath = FME_MacroValues['lockFile'] self。output = False try: os.remove(self.lockFilePath) except Exception as e: fmeobjects.FMELogFile().logMessageString("Not able to remove the file: %s" % str(e)) try: os.open(self.lockFilePath, os.O_CREAT|os.O_EXCL) self.output = True except Exception as e: fmeobjects.FMELogFile().logMessageString("There is already an instance running at this moment... %s" % str(e), fmeobjects.FME_WARN) def input(self, feature): if self.output: self.pyoutput(feature)
©2019安全亚搏在线软件公司法律