def dumpState(self):
DUMP_LOCK.acquire()
try:
TMP_STATE_FILENAME = STATE_FILENAME+".tmp"
open(TMP_STATE_FILENAME, 'w').close()
s = open(TMP_STATE_FILENAME, "wb")
p = pickle.Pickler(s, pickle.HIGHEST_PROTOCOL)
p.dump(self._agg)
p.dump(self._slices)
p.dump(self.proxy_dockermaster)
p.dump(self.public_url)
s.close()
copyfile(TMP_STATE_FILENAME, STATE_FILENAME)
except RuntimeError:
print 'error in DumpState'
pass
DUMP_LOCK.release()
评论列表
文章目录