def __exit__(self, type, value, tb): # pylint: disable=redefined-builtin
"""Exit RunSingleInstance class
:return: None
"""
try:
if not self.__is_running:
fcntl.lockf(self.__filelock, fcntl.LOCK_UN)
self.__filelock.close()
os.unlink(self.__lockfile)
except Exception as err:
logger.error("Error unlocking single instance file", error=err.message)
评论列表
文章目录