projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3aba70b
)
misc/cpu-watcher.tac: use writeaside-and-rename for the history.pickle file
author
Brian Warner
<warner@allmydata.com>
Wed, 1 Oct 2008 00:30:53 +0000
(17:30 -0700)
committer
Brian Warner
<warner@allmydata.com>
Wed, 1 Oct 2008 00:30:53 +0000
(17:30 -0700)
misc/cpu-watcher.tac
patch
|
blob
|
history
diff --git
a/misc/cpu-watcher.tac
b/misc/cpu-watcher.tac
index da8d29abedaae08b0e7c6db5ded1e2926b05bd85..9695a69458fa74cc3a9b6937e44004a618db6c52 100644
(file)
--- a/
misc/cpu-watcher.tac
+++ b/
misc/cpu-watcher.tac
@@
-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: