def restartInProcess(self, app):
args = sys.argv[:]
args.insert(0, sys.executable)
apppath = j.system.fs.joinPaths(j.dirs.appDir, app)
max_fd = 1024
for fd in range(3, max_fd):
try:
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
except IOError:
continue
fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
os.chdir(apppath)
os.execv(sys.executable, args)
# def getRedisClient(self,appname,actorname):
# if ini.checkSection("redis"):
# redisip=ini.getValue("redis","ipaddr")
# redisport=ini.getValue("redis","port")
#redisclient=redis.StrictRedis(host=redisip, port=int(redisport), db=0)
# else:
# redisclient=None
# return redisclient
评论列表
文章目录