mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 00:24:13 +00:00
misc/cpu-watcher.tac: use writeaside-and-rename for the history.pickle file
This commit is contained in:
parent
3aba70bbcf
commit
06770f720e
@ -199,7 +199,8 @@ class CPUWatcher(service.MultiService, resource.Resource, Referenceable):
|
||||
except:
|
||||
log.msg("error reading process %s (%s), ignoring" % (pid, name))
|
||||
log.err()
|
||||
pickle.dump(self.history, open("history.pickle", "wb"))
|
||||
pickle.dump(self.history, open("history.pickle.tmp", "wb"))
|
||||
os.rename("history.pickle.tmp", "history.pickle")
|
||||
for (pid, name) in processes:
|
||||
row = [name]
|
||||
for avg in self.AVERAGES:
|
||||
|
Loading…
x
Reference in New Issue
Block a user